summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/crash104.C
blob: 097c46982cb73861e4cd68a92a09ce9441002dca (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
// PR c++/46046

template <class T>
    struct foo
{
    template <class U, class V = void>
        struct type
    {};

    template <class V>
        struct type<
            typename T::template some_type<int>,
            V
        >
    {};
};

template <class T>
    class bar
{};

int main()
{
  typedef foo<bar<int> > cont;
  cont::type<char> obj; // { dg-error "cannot be defined" }
}