]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/28258 (ICE with invalid constructor)
authorLee Millward <lee.millward@gmail.com>
Sat, 22 Jul 2006 14:07:57 +0000 (14:07 +0000)
committerLee Millward <lmillward@gcc.gnu.org>
Sat, 22 Jul 2006 14:07:57 +0000 (14:07 +0000)
PR c++/28258
* method.c (locate_copy): Check for non_reference
returning error_mark_node.

* g++/dg/other/error10.C: New test.

From-SVN: r115675

gcc/cp/ChangeLog
gcc/cp/method.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/error10.C [new file with mode: 0644]

index b8e75fdb84182a36bf84c24631ba0cae95867d48..fa949db4770d1c28e2498e545d5fa5c6e05d5753 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-22  Lee Millward  <lee.millward@gmail.com>
+
+       PR c++/28258
+       * method.c (locate_copy): Check for non_reference
+       returning error_mark_node.
+       
 2006-07-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/28363
index 3126237b2a1ae37c5a83e3f036de61e7b0154d94..42211a1af570fbeeeb14f464bed5c1c255f94c06 100644 (file)
@@ -932,6 +932,10 @@ locate_copy (tree type, void *client_)
       if (!parms)
         continue;
       src_type = non_reference (TREE_VALUE (parms));
+
+      if (src_type ==  error_mark_node)
+        return NULL_TREE;
+
       if (!same_type_ignoring_top_level_qualifiers_p (src_type, type))
         continue;
       if (!sufficient_parms_p (TREE_CHAIN (parms)))
index 810230f41846cc07d4b900356d85a56dfcfbbc9e..e942d5df183264d864f1fe61301df23398852872 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-22  Lee Millward  <lee.millward@gmail.com>
+
+       PR c++/28258
+       * g++/dg/other/error10.C: New test.
+       
 2006-07-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/28363
diff --git a/gcc/testsuite/g++.dg/other/error10.C b/gcc/testsuite/g++.dg/other/error10.C
new file mode 100644 (file)
index 0000000..037e288
--- /dev/null
@@ -0,0 +1,10 @@
+//PR c++/28258
+
+struct A 
+{            // { dg-error "" }
+  A(void x); // { dg-error "invalid use|incomplete type|candidates" }
+};
+
+struct B : A {}; // { dg-error "no matching function for call" }
+B b; // { dg-error "synthesized method" }