diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-operator-neg.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-operator-neg.C | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-operator-neg.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-operator-neg.C new file mode 100644 index 0000000..d71f4a2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-operator-neg.C @@ -0,0 +1,42 @@ +// { dg-do compile { target c++11 } } + +// Can't have *both* literal operator template and raw literal operator. + +int +operator"" _abc(const char*) + { + return 42; + } + +template<char...> + int + operator"" _abc() // { dg-error "literal operator template|conflicts with raw literal operator" } + { + return 13; + } + +template<char...> + int + operator"" _def() + { + return 12; + } + +int +operator"" _def(const char*) // { dg-error "raw literal operator|conflicts with literal operator template" } + { + return 43; + } + +int +operator"" _ghi(long double) + { + return 42; + } + +template<char...> + int + operator"" _ghi() // OK + { + return 13; + } |