mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/5767 (ICE with forwarding template template parameters)
PR c++/5767 * parser.c (cp_parser_class_name): Return immediately when scope is error_mark_node. * g++.dg/parse/crash11.C: New test. From-SVN: r70226
This commit is contained in:
parent
7d1496792b
commit
3adee96c46
|
@ -1,3 +1,9 @@
|
|||
2003-08-07 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/5767
|
||||
* parser.c (cp_parser_class_name): Return immediately when scope
|
||||
is error_mark_node.
|
||||
|
||||
2003-08-07 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* cp/Make-lang.in (cp/call.o): Add dependency for target.h.
|
||||
|
|
|
@ -10957,6 +10957,9 @@ cp_parser_class_name (cp_parser *parser,
|
|||
/* PARSER->SCOPE can be cleared when parsing the template-arguments
|
||||
to a template-id, so we save it here. */
|
||||
scope = parser->scope;
|
||||
if (scope == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
/* Any name names a type if we're following the `typename' keyword
|
||||
in a qualified name where the enclosing scope is type-dependent. */
|
||||
typename_p = (typename_keyword_p && scope && TYPE_P (scope)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2003-08-07 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/5767
|
||||
* g++.dg/parse/crash11.C: New test.
|
||||
|
||||
2003-08-06 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* gcc.dg/cpp/spacing1.c: Update.
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
// { dg-do compile }
|
||||
|
||||
// Origin: priesnit@math.uni-goettingen.de
|
||||
|
||||
// PR c++/5767: ICE parsing typename with invalid scope.
|
||||
|
||||
template <template <typename> class TP>
|
||||
struct A
|
||||
{
|
||||
template <typename T>
|
||||
struct Template
|
||||
{
|
||||
typedef typename TP<T>::Type Type;
|
||||
};
|
||||
};
|
||||
template <template <typename> class TP>
|
||||
struct B
|
||||
{
|
||||
template <typename T>
|
||||
struct Template
|
||||
{
|
||||
typedef typename A<A<TP>::Template>
|
||||
::template Template<T>::Type Type; { dg-error "mismatch|class template|unqualified-id" }
|
||||
};
|
||||
};
|
||||
template <typename T>
|
||||
struct C
|
||||
{
|
||||
typedef void Type;
|
||||
};
|
||||
int main()
|
||||
{
|
||||
typedef B<C>::Template<void>::Type Type; { dg-error "init-declarator|;" }
|
||||
}
|
Loading…
Reference in New Issue