gcc/testsuite/g++.dg/template/canon-type-15.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | template<unsigned u> struct size_c{ static constexpr unsigned value = u; }; |
| 3 | namespace g { |
| 4 | template<class T> auto return_size(T t) -> size_c<sizeof(t)>; |
| 5 | template<class T> auto return_size(T t) -> size_c<sizeof(t)>; |
| 6 | } |
| 7 | static_assert(decltype(g::return_size('a'))::value == 1u, ""); |