Author: dyung
Date: 2026-01-05T10:30:23Z
New Revision: c377d11ee53dfefd685a1b6a4cc0804f9d4026af

URL: 
https://github.com/llvm/llvm-project/commit/c377d11ee53dfefd685a1b6a4cc0804f9d4026af
DIFF: 
https://github.com/llvm/llvm-project/commit/c377d11ee53dfefd685a1b6a4cc0804f9d4026af.diff

LOG: Update test for C++20 defaulting compilers after #173236 changed the 
expected diagnostic message. (#174377)

Change #173236 changed the emitted error message which caused the test
`clang/test/SemaCXX/typeid.cpp` to fail if tested with a compiler that
defaults to C++20 because the error message has changed. This change
updates the test to expect the correct error message depending on
whether the compiler defaults to C++20 or earlier.

Added: 
    

Modified: 
    clang/test/SemaCXX/typeid.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaCXX/typeid.cpp b/clang/test/SemaCXX/typeid.cpp
index 26cad1c88f4d6..51a18e624c23d 100644
--- a/clang/test/SemaCXX/typeid.cpp
+++ b/clang/test/SemaCXX/typeid.cpp
@@ -2,7 +2,12 @@
 
 void f()
 {
-  (void)typeid(int); // expected-error {{you need to include <typeinfo> before 
using the 'typeid' operator}}
+  (void)typeid(int);
+#if __cplusplus >= 202002L
+   // expected-error@-2 {{you need to include <typeinfo> or import std before 
using the 'typeid' operator}}
+#else
+   // expected-error@-4 {{you need to include <typeinfo> before using the 
'typeid' operator}}
+#endif
 }
 
 namespace std {


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to