aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C
new file mode 100644
index 0000000..2a31452
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C
@@ -0,0 +1,15 @@
+// { dg-do compile { target c++11 } }
+
+class Foo
+{
+public:
+ Foo() { }
+ int operator"" _Bar(char32_t); // { dg-error "must be a non-member function" }
+};
+
+int i = operator"" _Bar(U'x'); // { dg-error "was not declared in this scope" }
+int j = U'x'_Bar; // { dg-error "unable to find character literal operator" }
+
+int
+Foo::operator"" _Bar(char32_t) // { dg-error "must be a non-member function" }
+{ return 42; }