aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx11-user-defined-literals.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 08:37:16 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 08:37:16 +0000
commit3a5032b89df601ab2e0c5c7e9667db2301bf10cf (patch)
tree0a10005d35f407fbd895deec316270874c399ae8 /test/SemaCXX/cxx11-user-defined-literals.cpp
parenta9e88b2549add9766382c70d270dfd89fa33f7cf (diff)
Literal operator suffixes and regular names live in separate namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx11-user-defined-literals.cpp')
-rw-r--r--test/SemaCXX/cxx11-user-defined-literals.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx11-user-defined-literals.cpp b/test/SemaCXX/cxx11-user-defined-literals.cpp
index 4cfd4d382b..4bbecdb5b8 100644
--- a/test/SemaCXX/cxx11-user-defined-literals.cpp
+++ b/test/SemaCXX/cxx11-user-defined-literals.cpp
@@ -126,3 +126,12 @@ template<char...Cs> constexpr unsigned operator"" _hash() {
}
static_assert(0x1234_hash == 0x103eff5e, "");
static_assert(hash<'0', 'x', '1', '2', '3', '4'>(0) == 0x103eff5e, "");
+
+// Functions and literal suffixes go in separate namespaces.
+namespace Namespace {
+ template<char...> int operator"" _x();
+ int k = _x(); // expected-error {{undeclared identifier '_x'}}
+
+ int _y(unsigned long long);
+ int k2 = 123_y; // expected-error {{no matching literal operator for call to 'operator "" _y'}}
+}