aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-06-07 08:06:46 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-06-07 08:06:46 +0000
commite32764576e31e938e1257dd55e5c151db7a87e9e (patch)
treebdedfd66d3d07c0bc9326eea90856e559cac7e31 /gcc/cp
parent968c8001a2f049c533f1b00fc0f7c31a0b11015e (diff)
downloadgcc-e32764576e31e938e1257dd55e5c151db7a87e9e.zip
gcc-e32764576e31e938e1257dd55e5c151db7a87e9e.tar.gz
gcc-e32764576e31e938e1257dd55e5c151db7a87e9e.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 936db24..fb79f47 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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>
* cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 8056518..f97039b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8088,17 +8088,17 @@ grokdeclarator (const cp_declarator *declarator,
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)
{
error ("%qs declared as function returning a function", name);
- type = integer_type_node;
+ return error_mark_node;
}
if (TREE_CODE (type) == ARRAY_TYPE)
{
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'. */