re PR c++/38638 (ICE superfluous 'typename')
gcc/cp/ 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com> PR c++/38638 * parser.c (cp_parser_elaborated_type_specifier): If we have a typename tag and don't have either a TYPE_DECL or a TEMPLATE_ID_EXPR, set the type to NULL. gcc/testsuite/ 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com> PR c++/38638 * g++.dg/template/typename17.C: New testcase. * g++.dg/template/typename18.C: New testcase. From-SVN: r145107
This commit is contained in:
parent
b0957daf07
commit
8ec0d73b34
@ -1,3 +1,10 @@
|
|||||||
|
2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||||
|
|
||||||
|
PR c++/38638
|
||||||
|
* parser.c (cp_parser_elaborated_type_specifier): If we have a
|
||||||
|
typename tag and don't have either a TYPE_DECL or a
|
||||||
|
TEMPLATE_ID_EXPR, set the type to NULL.
|
||||||
|
|
||||||
2009-03-27 Simon Martin <simartin@users.sourceforge.net>
|
2009-03-27 Simon Martin <simartin@users.sourceforge.net>
|
||||||
|
|
||||||
PR c++/37647
|
PR c++/37647
|
||||||
|
@ -11588,7 +11588,11 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
|
|||||||
type = make_typename_type (parser->scope, decl,
|
type = make_typename_type (parser->scope, decl,
|
||||||
typename_type,
|
typename_type,
|
||||||
/*complain=*/tf_error);
|
/*complain=*/tf_error);
|
||||||
else
|
/* If the `typename' keyword is in effect and DECL is not a type
|
||||||
|
decl. Then type is non existant. */
|
||||||
|
else if (tag_type == typename_type && TREE_CODE (decl) != TYPE_DECL)
|
||||||
|
type = NULL_TREE;
|
||||||
|
else
|
||||||
type = TREE_TYPE (decl);
|
type = TREE_TYPE (decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||||
|
|
||||||
|
PR c++/38638
|
||||||
|
* g++.dg/template/typename17.C: New testcase.
|
||||||
|
* g++.dg/template/typename18.C: New testcase.
|
||||||
|
|
||||||
2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||||
|
|
||||||
PR c++/36799
|
PR c++/36799
|
||||||
|
10
gcc/testsuite/g++.dg/template/typename17.C
Normal file
10
gcc/testsuite/g++.dg/template/typename17.C
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
// This should fail as A::foo<0> is not a typename at all.
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
template<int> void foo(int i)
|
||||||
|
{
|
||||||
|
typename A::foo<0>(i1); // { dg-error "" }
|
||||||
|
}
|
||||||
|
};
|
14
gcc/testsuite/g++.dg/template/typename18.C
Normal file
14
gcc/testsuite/g++.dg/template/typename18.C
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
// These typename should work as they are types.
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
typedef int a;
|
||||||
|
template <int>
|
||||||
|
struct f {};
|
||||||
|
template<int> void foo(int i)
|
||||||
|
{
|
||||||
|
typename A::a(i1);
|
||||||
|
typename A::f<0>(i2);
|
||||||
|
}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user