================
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only 
-fexperimental-new-constant-interpreter -verify %s
+// expected-no-diagnostics
+
+// Test for issue #173950: Assertion `IsInitialized' failed when evaluating
+// typeid on a reference to a dynamically allocated object.
+
+namespace std {
+class type_info {};
+}
+
+namespace GH173950 {
+struct A {
+  virtual void f();
+};
+
+static A &a = *new A;
+extern A &a;
+
+// This used to crash with: Assertion `IsInitialized' failed in invokeDtor()
+const std::type_info &a_ti = typeid(a);
----------------
tbaederr wrote:

I'd rather add this to `typeid.cpp` if possible.

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

Reply via email to