[LLVMbugs] [Bug 15539] New: __has_include seems to be broken under #ifdef

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 18 15:43:43 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15539

            Bug ID: 15539
           Summary: __has_include seems to be broken under #ifdef
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: dblaikie at gmail.com
          Reporter: dblaikie at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

#if FOO
#elif __has_include(<foo>)
#endif

compiles without error, however

#ifdef FOO
#elif __has_include(<foo>)
#endif

produces:

typeinfo.cpp:2:7: error: __has_include must be used within a preprocessing
directive
#elif __has_include(<foo>)
      ^
typeinfo.cpp:2:7: error: invalid token at start of a preprocessor expression
<scratch space>:2:1: note: expanded from here
0
^
2 errors generated.

(discovered in a change to libc++, r177297)

-- 
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/20130318/8f9fc1ee/attachment.html>


More information about the llvm-bugs mailing list