2010-01-13 17:01:02 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2010-08-30 05:26:48 +08:00
|
|
|
template <typename T, typename U> struct same_type {
|
|
|
|
static const bool value = false;
|
2010-01-13 17:01:02 +08:00
|
|
|
};
|
|
|
|
|
2010-08-30 05:26:48 +08:00
|
|
|
template <typename T> struct same_type<T, T> {
|
|
|
|
static const bool value = true;
|
|
|
|
};
|
2010-01-13 17:01:02 +08:00
|
|
|
|
2010-08-30 05:26:48 +08:00
|
|
|
int operator "" _int (const char *, size_t);
|
|
|
|
static_assert(same_type<int, decltype(""_int)>::value, "not the same type!");
|
2010-01-13 17:01:02 +08:00
|
|
|
|
2010-08-30 05:26:48 +08:00
|
|
|
int i = ""_int;
|
|
|
|
int j = L""_int; // expected-error {{no matching literal operator function}}
|
2010-01-13 17:01:02 +08:00
|
|
|
|
2010-08-30 05:26:48 +08:00
|
|
|
int operator "" _int (const wchar_t *, size_t);
|
2010-01-13 17:01:02 +08:00
|
|
|
|
2010-08-30 05:26:48 +08:00
|
|
|
int k = L""_int;
|
2010-01-13 17:01:02 +08:00
|
|
|
|