I tried it for myself. We seem to have different gcc versions, because my output looks like this:
g++ test.cc
In file included from file3.h:1:0,
from file2.h:1,
from file1.h:2,
from test.cc:2:
file4.h:1:2: warning: #warning "you are bad at c++" [-Wcpp]
But I still see the problem. Apparently, it's the 'gcc-include
regexp that breaks things. In my situation, all those "from" lines match correctly but the last one. The problem is that it ends in a colon and this somehow makes it a warning. I'm a bit lazy now to check what possible gcc output message does such matching target (there should be a reason for it, huh?), so I'll just answer the question:
;; This element is what controls the matching behaviour: according to
;; `compilation-error-regexp-alist` doc, it means if subexpression 4 of the
;; regexp matches, it's a warning, if subexpression 5 matches, it's an info.
(nth 5 (assoc 'gcc-include compilation-error-regexp-alist-alist))
(4 . 5)
;; We could try and tinker with the regexp, but it's simpler to just set it as
;; "always match as info".
(setf (nth 5 (assoc 'gcc-include compilation-error-regexp-alist-alist)) 0)
This snippet stopped compilation mode from highlighting last "from" line as a warning for me.