[llvm-bugs] [Bug 27217] New: C++ language feature macros are also set for clang.exe/clang-cl.exe (but not in MSVC2015's cl.exe)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 5 07:02:09 PDT 2016


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

            Bug ID: 27217
           Summary: C++ language feature macros are also set for
                    clang.exe/clang-cl.exe (but not in MSVC2015's cl.exe)
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nikolai.kosjar at theqtcompany.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider

---8<--- D:\work\cppfeaturetest.cpp ---8<---
#ifdef __cpp_constexpr
 #error "HAS __cpp_constexpr"
#else
 #error "NO __cpp_constexpr defined"
#endif
---8<---------------------------------------

...and feeding that to clang.exe:


  D:\work>D:\usr\llvm-3.8.0\bin\clang.exe D:\work\cppfeaturetest.cpp
  D:\work\cppfeaturetest.cpp:2:3: error: "HAS __cpp_constexpr"
   #error "HAS __cpp_constexpr"
    ^
  1 error generated.

and cl.exe (MSVC2015):

  D:\work>cl.exe D:\work\cppfeaturetest.cpp
  Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86
  Copyright (C) Microsoft Corporation.  All rights reserved.

  cppfeaturetest.cpp
  D:\work\cppfeaturetest.cpp(4): fatal error C1189: #error:  "NO
__cpp_constexpr defined"

Client code checking for these macros causes trouble with
clang.exe/clang-cl.exe.

-- 
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/20160405/38d0f3d9/attachment.html>


More information about the llvm-bugs mailing list