aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/arrow1.C
blob: c96141063a0d392a48e0ef853262039086c4d545 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/49118
// { dg-do compile }

template< int n >
struct a {
    a< n+1 >
	operator->()
	{ return a< n+1 >(); }
};

int main() {
    a<0>()->x; // { dg-error "instantiation depth exceeds maximum" }
}

// { dg-prune-output "incomplete type" }
// { dg-prune-output "declaration of" }
// { dg-prune-output "used but never defined" }