summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/ale/handlers/gcc.vim2
-rw-r--r--test/handler/test_gcc_handler.vader14
2 files changed, 15 insertions, 1 deletions
diff --git a/autoload/ale/handlers/gcc.vim b/autoload/ale/handlers/gcc.vim
index 9ec7b110..4b53652a 100644
--- a/autoload/ale/handlers/gcc.vim
+++ b/autoload/ale/handlers/gcc.vim
@@ -48,7 +48,7 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
let l:item = {
\ 'lnum': str2nr(l:match[2]),
- \ 'type': l:match[4] is# 'error' ? 'E' : 'W',
+ \ 'type': (l:match[4] is# 'error' || l:match[4] is# 'fatal error') ? 'E' : 'W',
\ 'text': s:RemoveUnicodeQuotes(l:match[5]),
\}
diff --git a/test/handler/test_gcc_handler.vader b/test/handler/test_gcc_handler.vader
index 79f17899..678d3f42 100644
--- a/test/handler/test_gcc_handler.vader
+++ b/test/handler/test_gcc_handler.vader
@@ -148,3 +148,17 @@ Execute(The GCC handler should interpret - as being the current file):
\ ale#handlers#gcc#HandleGCCFormat(347, [
\ '-:6:12: error: Some error',
\ ])
+
+Execute(The GCC handler should handle fatal error messages due to missing files):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 12,
+ \ 'type': 'E',
+ \ 'text': 'foo.h: No such file or directory'
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormat(347, [
+ \ '<stdin>:3:12: fatal error: foo.h: No such file or directory',
+ \ ])