OSDN Git Service

* parser.c (cp_parser_class_specifier): Set class location to that
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / meminit2.C
1 // { dg-do compile }
2 // Origin: Mark Anders <mark dot a dot anders at intel dot com>
3 // PR c++/15503: disambiguators in base classes and mem-initializers
4
5 template <typename K1> struct O {  
6   template <typename K2> struct I {}; 
7 }; 
8
9 template <typename T> 
10 struct A : typename O<T>::template I<int> {   // { dg-error "keyword 'typename' not allowed" }
11   A() :    typename O<T>::template I<int>()   // { dg-error "keyword 'typename' not allowed" }
12   {}
13 };
14
15 template <typename T> 
16 struct B : O<T>::template I<int> {
17   B() :    O<T>::I<int>()   // { dg-error "used as template|it is a template" "" }
18   {}
19 };
20
21 // { dg-bogus "end of input" "bogus token skipping in the parser" { xfail *-*-* } 17 }