PR c++/85765 - SFINAE and non-type default template arg.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / decltype52.C
blobe6b5a4cafb4fdec4f3207cf852747969cdc65aaa
1 // PR c++/56450
2 // { dg-do compile { target c++11 } }
4 template<typename T>
5 T&& declval();
7 template<typename, typename>
8 struct is_same
9 { static constexpr bool value = false; };
11 template<typename T>
12 struct is_same<T, T>
13 { static constexpr bool value = true; };
15 struct A { static const int dummy = 0; };
17 static_assert(is_same<decltype(declval<A>().dummy), const int>::value, "");
18 static_assert(!is_same<decltype(declval<A>().dummy), const int&>::value, "");