PR c++/28109
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2006 09:28:02 +0000 (09:28 +0000)
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2006 09:28:02 +0000 (09:28 +0000)
* rtti.c (get_tinfo_decl_dynamic): Robustify.

* g++.dg/rtti/incomplete1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114882 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/rtti.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/rtti/incomplete1.C [new file with mode: 0644]

index 7f022ad..f666fab 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/28109
+       * rtti.c (get_tinfo_decl_dynamic): Robustify.
+
 2006-06-20  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/28052
index 898db00..469ce51 100644 (file)
@@ -228,7 +228,7 @@ get_tinfo_decl_dynamic (tree exp)
   tree type;
   tree t;
 
-  if (exp == error_mark_node)
+  if (error_operand_p (exp))
     return error_mark_node;
 
   /* peel back references, so they match.  */
index 3e9165c..d08e87c 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/28109
+       * g++.dg/rtti/incomplete1.C: New test.
+
 2006-06-21  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/loop_unchecked_conversion.ad[bs]: New test.
diff --git a/gcc/testsuite/g++.dg/rtti/incomplete1.C b/gcc/testsuite/g++.dg/rtti/incomplete1.C
new file mode 100644 (file)
index 0000000..2bf46e0
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/28109
+// { dg-do compile }
+
+#include <typeinfo>
+
+struct A;
+
+void foo()
+{
+  A a;  // { dg-error "incomplete type" }
+  typeid (a);
+}