blob: 93fd4b6a1424c9aafe63f3d5714b60b9ad3c1791 [file] [log] [blame]
Sean Hunta6c058d2010-01-13 09:01:02 +00001// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
2
3#include <stddef.h>
4
Sean Hunt0016d512010-08-29 21:26:48 +00005template <typename T, typename U> struct same_type {
6 static const bool value = false;
Sean Hunta6c058d2010-01-13 09:01:02 +00007};
8
Sean Hunt0016d512010-08-29 21:26:48 +00009template <typename T> struct same_type<T, T> {
10 static const bool value = true;
11};
Sean Hunta6c058d2010-01-13 09:01:02 +000012
Sean Hunt0016d512010-08-29 21:26:48 +000013int operator "" _int (const char *, size_t);
14static_assert(same_type<int, decltype(""_int)>::value, "not the same type!");
Sean Hunta6c058d2010-01-13 09:01:02 +000015
Sean Hunt0016d512010-08-29 21:26:48 +000016int i = ""_int;
17int j = L""_int; // expected-error {{no matching literal operator function}}
Sean Hunta6c058d2010-01-13 09:01:02 +000018
Sean Hunt0016d512010-08-29 21:26:48 +000019int operator "" _int (const wchar_t *, size_t);
Sean Hunta6c058d2010-01-13 09:01:02 +000020
Sean Hunt0016d512010-08-29 21:26:48 +000021int k = L""_int;
Sean Hunta6c058d2010-01-13 09:01:02 +000022