Commit 5d1d00c3 authored by Philipp Stephani's avatar Philipp Stephani
Browse files

Add a new compile error regexp for Clang includes

Clang uses a slight variation of GCC's include format, causing includes
to be treated as warnings instead of informational messages.  Use a new
regular expression instead.

* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): New element
`clang-include' for Clang-style "included from" lines.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add unit test.
parent 4b6baba2
...@@ -230,6 +230,13 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ...@@ -230,6 +230,13 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
nil 1 nil 2 0 nil 1 nil 2 0
(2 (compilation-face '(3)))) (2 (compilation-face '(3))))
(clang-include
,(rx bol "In file included from "
(group (+ (not (any ?\n ?:)))) ?:
(group (+ (any (?0 . ?9)))) ?:
eol)
1 2 nil 0)
(gcc-include (gcc-include
"^\\(?:In file included \\| \\|\t\\)from \ "^\\(?:In file included \\| \\|\t\\)from \
\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\ \\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\
......
...@@ -83,6 +83,9 @@ ...@@ -83,6 +83,9 @@
1 nil 302 "\\lib\\python\\Products\\PythonScripts\\PythonScript.py") 1 nil 302 "\\lib\\python\\Products\\PythonScripts\\PythonScript.py")
("File \"/tmp/foo.py\", line 10" ("File \"/tmp/foo.py\", line 10"
1 nil 10 "/tmp/foo.py") 1 nil 10 "/tmp/foo.py")
;; clang-include
("In file included from foo.cpp:2:"
1 nil 2 "foo.cpp" 0)
;; cmake cmake-info ;; cmake cmake-info
("CMake Error at CMakeLists.txt:23 (hurz):" ("CMake Error at CMakeLists.txt:23 (hurz):"
1 nil 23 "CMakeLists.txt") 1 nil 23 "CMakeLists.txt")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment