1 // PR c++/48969 2 // { dg-do compile { target c++11 } } 3 // { dg-options "-ftemplate-depth=10" } 4 5 template<unsigned int N> struct Pair { }; 6 struct Foo { enum { Mask = 1 }; } foo; 7 template<typename A, typename B> class Pair<A::Mask | B::Mask> // { dg-error "depth" } 8 operator|(const A &, const B &) 9 { } 10 11 Pair<Foo::Mask> f = foo|foo; // { dg-message "from here" } 12 13 // { dg-prune-output "compilation terminated" } 14