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

            Bug ID: 46230
           Summary: clang-cl incorrectly defines __cpp_rtti when /GR- is
                    specified
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

// test-rtti.cpp
#ifdef __cpp_rtti
#warning __cpp_rtti defined
#endif
#ifdef _CPPRTTI
#warning _CPPRTTI defined
#endif

tested llvm 10, and 693ff89f47ffe1f357ddd3a5112cd90eb8b3e2d1

clang-cl -c /GR- test-rtti.cpp
test-rtti.cpp(2,2): warning: __cpp_rtti defined [-W#warnings]
#warning __cpp_rtti defined
 ^
1 warning generated.

clang-cl -c /GR test-rtti.cpp
test-rtti.cpp(2,2): warning: __cpp_rtti defined [-W#warnings]
#warning __cpp_rtti defined
 ^
test-rtti.cpp(5,2): warning: _CPPRTTI defined [-W#warnings]
#warning _CPPRTTI defined
 ^
2 warnings generated.

clang -c -frtti test-rtti.cpp
test-rtti.cpp:2:2: warning: __cpp_rtti defined [-W#warnings]
#warning __cpp_rtti defined
 ^
test-rtti.cpp:5:2: warning: _CPPRTTI defined [-W#warnings]
#warning _CPPRTTI defined
 ^
2 warnings generated.

clang -c -fno-rtti test-rtti.cpp
// expected, neither is defined.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to