[llvm-bugs] [Bug 23951] __has_include not reported by "clang -dM -E - < /dev/null"

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 6 23:32:40 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=23951

Fangrui Song <i at maskray.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i at maskray.me
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #3 from Fangrui Song <i at maskray.me> ---
> I'm leaning towards saying that this is a GCC-specific behaviour we don't want to reproduce.

+1

--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -787,18 +787,66 @@ c_cpp_builtins (cpp_reader *pfile)
   /* For stddef.h.  They require macros defined in c-common.c.  */
   c_stddef_cpp_builtins ();

+  /* Set include test macros for all C/C++ (not for just C++11 etc.)
+     the builtins __has_include__ and __has_include_next__ are defined
+     in libcpp.  */
+  cpp_define (pfile, "__has_include(STR)=__has_include__(STR)");
+  cpp_define (pfile, "__has_include_next(STR)=__has_include_next__(STR)");
+

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190707/05bfb7f1/attachment.html>


More information about the llvm-bugs mailing list