Sean Hunt | a6c058d | 2010-01-13 09:01:02 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s |
| 2 | |
| 3 | #include <stddef.h> |
| 4 | |
Sean Hunt | 0016d51 | 2010-08-29 21:26:48 +0000 | [diff] [blame^] | 5 | template <typename T, typename U> struct same_type { |
| 6 | static const bool value = false; |
Sean Hunt | a6c058d | 2010-01-13 09:01:02 +0000 | [diff] [blame] | 7 | }; |
| 8 | |
Sean Hunt | 0016d51 | 2010-08-29 21:26:48 +0000 | [diff] [blame^] | 9 | template <typename T> struct same_type<T, T> { |
| 10 | static const bool value = true; |
| 11 | }; |
Sean Hunt | a6c058d | 2010-01-13 09:01:02 +0000 | [diff] [blame] | 12 | |
Sean Hunt | 0016d51 | 2010-08-29 21:26:48 +0000 | [diff] [blame^] | 13 | int operator "" _int (const char *, size_t); |
| 14 | static_assert(same_type<int, decltype(""_int)>::value, "not the same type!"); |
Sean Hunt | a6c058d | 2010-01-13 09:01:02 +0000 | [diff] [blame] | 15 | |
Sean Hunt | 0016d51 | 2010-08-29 21:26:48 +0000 | [diff] [blame^] | 16 | int i = ""_int; |
| 17 | int j = L""_int; // expected-error {{no matching literal operator function}} |
Sean Hunt | a6c058d | 2010-01-13 09:01:02 +0000 | [diff] [blame] | 18 | |
Sean Hunt | 0016d51 | 2010-08-29 21:26:48 +0000 | [diff] [blame^] | 19 | int operator "" _int (const wchar_t *, size_t); |
Sean Hunt | a6c058d | 2010-01-13 09:01:02 +0000 | [diff] [blame] | 20 | |
Sean Hunt | 0016d51 | 2010-08-29 21:26:48 +0000 | [diff] [blame^] | 21 | int k = L""_int; |
Sean Hunt | a6c058d | 2010-01-13 09:01:02 +0000 | [diff] [blame] | 22 | |