OSDN Git Service

/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Oct 2010 21:51:50 +0000 (21:51 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Oct 2010 21:51:50 +0000 (21:51 +0000)
2010-10-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/46117
* call.c (add_function_candidate): Don't use TREE_VALUE on null
parmnode.

/testsuite
2010-10-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/46117
* g++.dg/parse/crash57.C: New.

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

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/crash57.C [new file with mode: 0644]

index 24cfd39..ea83f25 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/46117
+       * call.c (add_function_candidate): Don't use TREE_VALUE on null
+       parmnode.
+
 2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * parser.c (cp_parser_objc_method_type): Mark inline.  Return a
@@ -6,9 +12,9 @@
        cp_parser_objc_method_type and to objc_build_method_signature.
        (cp_parser_objc_method_prototype_list): Updated calls to
        objc_add_method_declaration.  Use token->type to determine if it
-       is a class method or not.       
+       is a class method or not.
        (cp_parser_objc_method_definition_list): Same change.
-       
+
 2010-10-20  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
 
        PR c++/46056
@@ -20,7 +26,7 @@
        * cp-lang.c (finish_file): Removed.
        * decl2.c (cp_write_global_declarations): Call
        objc_write_global_declarations when compiling Objective-C++.
-       
+
 2010-10-19  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/46046
index 1ecc367..bdf97a2 100644 (file)
@@ -1613,9 +1613,10 @@ add_function_candidate (struct z_candidate **candidates,
   /* Kludge: When looking for a function from a subobject while generating
      an implicit copy/move constructor/operator=, don't consider anything
      that takes (a reference to) an unrelated type.  See c++/44909.  */
-  else if ((flags & LOOKUP_SPECULATIVE)
-          || (current_function_decl
-              && DECL_DEFAULTED_FN (current_function_decl)))
+  else if (parmlist
+          && ((flags & LOOKUP_SPECULATIVE)
+              || (current_function_decl
+                  && DECL_DEFAULTED_FN (current_function_decl))))
     {
       if (DECL_CONSTRUCTOR_P (fn))
        i = 1;
index b52798d..5e9b6a1 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/46117
+       * g++.dg/parse/crash57.C: New.
+
 2010-10-21  Uros Bizjak  <ubizjak@gmail.com>
            H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/gcc/testsuite/g++.dg/parse/crash57.C b/gcc/testsuite/g++.dg/parse/crash57.C
new file mode 100644 (file)
index 0000000..c6daf77
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/46117
+
+struct A
+{
+  A (typename int); // { dg-error "before|declaration" }
+};
+
+struct B : A {};
+
+B b;