mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-11 20:15:29 +08:00
PR c++/9364, c++/10553, c++/10586
PR c++/9364, c++/10553, c++/10586 * decl.c (make_typename_type): Don't crash on illegal code. * g++.dg/parse/typename4.C: New test. * g++.dg/parse/typename5.C: Likewise. From-SVN: r66424
This commit is contained in:
parent
82a98427a9
commit
5dc5d13c70
@ -1,3 +1,8 @@
|
||||
2003-05-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/9364, c++/10553, c++/10586
|
||||
* decl.c (make_typename_type): Don't crash on illegal code.
|
||||
|
||||
2003-05-03 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* class.c (finish_struct): Use location_t and input_location
|
||||
|
@ -5418,6 +5418,11 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
|
||||
{
|
||||
tree fullname;
|
||||
|
||||
if (name == error_mark_node
|
||||
|| context == NULL_TREE
|
||||
|| context == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
if (TYPE_P (name))
|
||||
{
|
||||
if (!(TYPE_LANG_SPECIFIC (name)
|
||||
|
@ -1,3 +1,9 @@
|
||||
2003-05-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/9364, c++/10553, c++/10586
|
||||
* g++.dg/parse/typename4.C: New test.
|
||||
* g++.dg/parse/typename5.C: Likewise.
|
||||
|
||||
2003-05-03 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* gcc.c-torture/compile/20030503-1.c: New test.
|
||||
|
7
gcc/testsuite/g++.dg/parse/typename4.C
Normal file
7
gcc/testsuite/g++.dg/parse/typename4.C
Normal file
@ -0,0 +1,7 @@
|
||||
// { dg-do compile }
|
||||
|
||||
// Origin: Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
|
||||
|
||||
// PR c++/9364: ICE processing typename with name error.
|
||||
|
||||
void find(typename int&); // { dg-error "typename|void|expected" }
|
12
gcc/testsuite/g++.dg/parse/typename5.C
Normal file
12
gcc/testsuite/g++.dg/parse/typename5.C
Normal file
@ -0,0 +1,12 @@
|
||||
// { dg-do compile }
|
||||
|
||||
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
// PR c++/10553: ICE processing typename with context error.
|
||||
|
||||
template <typename> struct A {};
|
||||
|
||||
template <typename> struct B
|
||||
{
|
||||
typedef A<typename X::Y> C; // { dg-error "not a class-name|invalid|no type" }
|
||||
};
|
Loading…
Reference in New Issue
Block a user