1 // PR c++/87145 2 // { dg-do compile { target c++11 } } 3 4 struct S { 5 int val; 6 7 constexpr operator int() const { 8 return static_cast<int>(val); 9 } 10 }; 11 12 template<int N> 13 struct F { }; 14 15 template<unsigned N> foo()16constexpr void foo() { 17 F<int{N}> f; 18 F<S{N}> f2; 19 } 20 21 int main()22main() 23 { 24 foo<2>(); 25 } 26