https://github.com/hongtaihu updated 
https://github.com/llvm/llvm-project/pull/244118

>From 82f00d256b7c5554a79f6942b61b8ce86d430771 Mon Sep 17 00:00:00 2001
From: hongtaihu <[email protected]>
Date: Thu, 19 Nov 2026 15:14:07 +0800
Subject: [PATCH 1/2] [Clang][NFC] Remove redundant disabled typeid lvalue test

The disabled block only checked __is_lvalue_expr(typeid(1)). The same 
value-category requirement is already exercised through &typeid(...) in the 
existing AST and constant-interpreter tests, including 
AST/ast-dump-APValue-lvalue.cpp and AST/ByteCode/typeid.cpp. Taking the address 
of typeid requires an lvalue, and the AST dump test also checks that the 
resulting APValue is an lvalue type-id.
---
 clang/test/SemaCXX/expression-traits.cpp | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/clang/test/SemaCXX/expression-traits.cpp 
b/clang/test/SemaCXX/expression-traits.cpp
index 64ddca091e9482..644b94be278472 100644
--- a/clang/test/SemaCXX/expression-traits.cpp
+++ b/clang/test/SemaCXX/expression-traits.cpp
@@ -433,14 +433,6 @@ void expr_dynamic_cast_5()
 // defect that is being corrected by the response to UK65 (see
 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2841.html).
 
-#if 0
-void expr_typeid_1()
-{
-    // expr.typeid/1: The result of a typeid expression is an lvalue...
-    ASSERT_LVALUE(typeid(1));
-}
-#endif
-
 void expr_static_cast_1(int x)
 {
     // expr.static.cast/1: The result of the expression

>From 10b9e80d9bf19f98512f7f55f5889f47ac081291 Mon Sep 17 00:00:00 2001
From: hongtaihu <[email protected]>
Date: Thu, 19 Nov 2026 22:46:58 +0800
Subject: [PATCH 2/2] [Clang][test] Enable typeid lvalue expression trait
 coverage

---
 clang/test/SemaCXX/expression-traits.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/clang/test/SemaCXX/expression-traits.cpp 
b/clang/test/SemaCXX/expression-traits.cpp
index 644b94be278472..f4a50d1122bf19 100644
--- a/clang/test/SemaCXX/expression-traits.cpp
+++ b/clang/test/SemaCXX/expression-traits.cpp
@@ -433,6 +433,18 @@ void expr_dynamic_cast_5()
 // defect that is being corrected by the response to UK65 (see
 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2841.html).
 
+// typeid requires std::type_info to be declared.
+namespace std {
+class type_info;
+}
+
+void expr_typeid_1()
+{
+    // expr.typeid/1: The result of a typeid expression is an lvalue...
+    ASSERT_LVALUE(typeid(1));
+    ASSERT_LVALUE(typeid(int));
+}
+
 void expr_static_cast_1(int x)
 {
     // expr.static.cast/1: The result of the expression

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

Reply via email to