1 // Based on an example in https://cpplover.blogspot.com/2013/12/c03c11_3905.html (in Japanese) 2 // A C++03 compiler may accepts this input but a C++11 compiler may not. 3 template <class T> struct X { }; 4 template <int N> struct Y { }; 5 #define M 2 6 struct S { 7 int i; 8 X< Y< 1 >> 2 > > x2; 9 X< Y< M >> 2 > > x3; 10 X< Y< M >> M > > x4; 11 X< Y< 1 < 2 > > x5; 12 X< Y< M < 2 > > x6; 13 X< Y< M < M > > x7; 14 /* Too ambiguous even in C++03 15 --------------------------- 16 X< Y< 1 > 2 > > x8; 17 X< Y< M > 2 > > x9; 18 X< Y< M > M > > xa; */ 19 double d; 20 }; 21