llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (dyung)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/174377.diff


1 Files Affected:

- (modified) clang/test/SemaCXX/typeid.cpp (+6-1) 


``````````diff
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 {

``````````

</details>


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

Reply via email to