| 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s |
| 2 | |
| 3 | using size_t = decltype(sizeof(int)); |
| 4 | |
| 5 | template<typename T, typename U> struct same_type; |
| 6 | template<typename T> struct same_type<T, T> {}; |
| 7 | template<typename T> using X = T; |
| 8 | template<typename CharT, X<CharT>...> |
| 9 | int operator "" _x(); // expected-warning {{string literal operator templates are a GNU extension}} |
| 10 | template<char...> |
| 11 | double operator "" _x(); |
| 12 | |
| 13 | auto a="string"_x; |
| 14 | auto b=42_x; |
| 15 | same_type<decltype(a), int> test_a; |
| 16 | same_type<decltype(b), double> test_b; |
| 17 | |
| 18 | char operator "" _x(const char *begin, size_t size); |
| 19 | auto c="string"_x; |
| 20 | auto d=L"string"_x; |
| 21 | same_type<decltype(c), char> test_c; |
| 22 | same_type<decltype(d), int> test_d; |
| 23 | |