Commit e3276457 by Paolo Carlini Committed by Paolo Carlini

re PR c++/35327 (ICE with invalid constructor)

/cp
2008-06-07  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35327
        * decl.c (grokdeclarator): In case of wrong return type return
	immediately error_mark_node.

/testsuite
2008-06-07  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35327
        * g++.dg/parse/crash41.C: New.

From-SVN: r136518
parent 968c8001
2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35327
* decl.c (grokdeclarator): In case of wrong return type return
immediately error_mark_node.
2008-06-06 Jakub Jelinek <jakub@redhat.com> 2008-06-06 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info, * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
......
...@@ -8088,17 +8088,17 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -8088,17 +8088,17 @@ grokdeclarator (const cp_declarator *declarator,
set_no_warning = true; set_no_warning = true;
} }
/* Warn about some types functions can't return. */ /* Error about some types functions can't return. */
if (TREE_CODE (type) == FUNCTION_TYPE) if (TREE_CODE (type) == FUNCTION_TYPE)
{ {
error ("%qs declared as function returning a function", name); error ("%qs declared as function returning a function", name);
type = integer_type_node; return error_mark_node;
} }
if (TREE_CODE (type) == ARRAY_TYPE) if (TREE_CODE (type) == ARRAY_TYPE)
{ {
error ("%qs declared as function returning an array", name); error ("%qs declared as function returning an array", name);
type = integer_type_node; return error_mark_node;
} }
/* Pick up type qualifiers which should be applied to `this'. */ /* Pick up type qualifiers which should be applied to `this'. */
......
2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35327
* g++.dg/parse/crash41.C: New.
2008-06-06 Jakub Jelinek <jakub@redhat.com> 2008-06-06 Jakub Jelinek <jakub@redhat.com>
PR target/36362 PR target/36362
......
// PR c++/35327
struct A
{
A(int)(); // { dg-error "declared" }
};
template<int> void foo(bool b, A a) { b ? a : 0; } // { dg-error "no match" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment