re PR preprocessor/15638 (gcc should have option to treat missing headers as fatal)
PR preprocessor/15638
gcc:
* c-common.c (c_cpp_error): Handle CPP_DL_FATAL.
gcc/fortran:
* cpp.c (cb_cpp_error): Handle CPP_DL_FATAL.
gcc/testsuite:
* gcc.dg/cpp/missing-header-1.c: New test.
* gcc.dg/cpp/include2.c: Only test #include <>. Expect
"compilation terminated" message.
* gcc.dg/cpp/include2a.c: New test. Copy of include2.c but only
test #include "".
* gcc.dg/pch/counter-2.c, gcc.dg/pch/valid-1.c,
gcc.dg/pch/valid-2.c, gcc.dg/pch/warn-1.c: Expect "compilation
terminated" message.
libcpp:
* files.c (_cpp_find_file): Call open_file_failed after diagnosing
invalid PCH.
(open_file_failed): Make error for missing file fatal.
* include/cpplib.h (CPP_DL_FATAL): Define.
From-SVN: r145341
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index ffde40e..adc6cf1 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -813,6 +813,8 @@
#define CPP_DL_ICE 0x04
/* An informative note following a warning. */
#define CPP_DL_NOTE 0x05
+/* A fatal error. */
+#define CPP_DL_FATAL 0x06
/* Output a diagnostic of some kind. */
extern bool cpp_error (cpp_reader *, int, const char *msgid, ...)