aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse/crash11.C
blob: 4893678d46f27d02a9344f7cc46ab75acc573b20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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|;" }
}