Commit 32273f9f by Lee Millward Committed by Lee Millward

re PR c++/28303 (ICE on invalid typedef)

        PR c++/28303
        * decl.c (grokdeclarator): Return error_mark_node on
        declaration with two or more data types.

        * g++.dg/template/typedef6.C: New test.
        * g++.dg/init/error1.C: Adjust error markers.
        * g++.dg/parse/crash9.C: Likewise.
        * g++.dg/template/crash55.C: Likewise.

From-SVN: r117118
parent d2a8ac2c
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
PR c++/28861 PR c++/28861
* decl.c (shadow_tag): Return error_mark_node * decl.c (shadow_tag): Return error_mark_node
if maybe_process_partial_specialization failed. if maybe_process_partial_specialization failed.
PR c++/28303
* decl.c (grokdeclarator): Return error_mark_node on
declaration with two or more data types.
2006-09-20 Danny Smith <dannysmith@users.sourceforge.net> 2006-09-20 Danny Smith <dannysmith@users.sourceforge.net>
......
...@@ -7117,7 +7117,11 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7117,7 +7117,11 @@ grokdeclarator (const cp_declarator *declarator,
/* If there were multiple types specified in the decl-specifier-seq, /* If there were multiple types specified in the decl-specifier-seq,
issue an error message. */ issue an error message. */
if (declspecs->multiple_types_p) if (declspecs->multiple_types_p)
error ("two or more data types in declaration of %qs", name); {
error ("two or more data types in declaration of %qs", name);
return error_mark_node;
}
/* Extract the basic type from the decl-specifier-seq. */ /* Extract the basic type from the decl-specifier-seq. */
type = declspecs->type; type = declspecs->type;
if (type == error_mark_node) if (type == error_mark_node)
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
PR c++/28861 PR c++/28861
* g++.dg/template/spec32.C: New test. * g++.dg/template/spec32.C: New test.
* g++.dg/parse/crash9.C: Adjust error markers. * g++.dg/parse/crash9.C: Adjust error markers.
PR c++/28303
* g++.dg/template/typedef6.C: New test.
* g++.dg/init/error1.C: Adjust error markers.
* g++.dg/parse/crash9.C: Likewise.
* g++.dg/template/crash55.C: Likewise.
2006-09-21 Janis Johnson <janis187@us.ibm.com> 2006-09-21 Janis Johnson <janis187@us.ibm.com>
// PR c++/12696 // PR c++/12696
struct A { struct A {
static float b[10]; // { dg-error "" } static float b[10];
} }
float A::b[] = {1,2,3}; // { dg-error "" } float A::b[] = {1,2,3}; // { dg-error "" }
//PR c++/27668 //PR c++/27668
template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" } template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" }
struct A {}; // { dg-error "definition" struct A {}; // { dg-error "definition|template" }
template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" } template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" }
//PR c++/28303
template<typename T> struct A
{
typedef struct typename T::X X; // { dg-error "expected identifier|two or more" }
};
template<typename T> A<T>::X::X() {} // { dg-error "not a type|forbids declaration" }
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