We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e74074 commit 0076d68Copy full SHA for 0076d68
clang/test/AST/ByteCode/typeid.cpp
@@ -59,3 +59,13 @@ namespace TypeidPtrInEvaluationResult {
59
consteval const std::type_info *ftype_info() { return &typeid(c); }
60
const std::type_info *T1 = ftype_info();
61
}
62
+
63
+// Regression test for crash in ArrayElemPtrPop with typeid pointers. GH-163127
64
+namespace TypeidPtrRegression {
65
+ void dontcrash() {
66
+ // this should just be an error and not an ICE
67
+ constexpr auto res = ((void**)&typeid(int))[0]; // both-error {{must be initialized by a constant expression}} \
68
+ // both-note {{cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
69
+ }
70
+}
71
0 commit comments