Lines Matching +full:- +full:- +full:user
1 // RUN: %clang_cc1 -std=c++11 -verify %s -fms-extensions -triple x86_64-apple-darwin9.0.0
3 // A ud-suffix cannot be used on string literals in a whole bunch of contexts:
5 #include "foo"_bar // expected-error {{expected "FILENAME" or <FILENAME>}}
6 #line 1 "foo"_bar // expected-error {{user-defined suffix cannot be used here}}
7 # 1 "foo"_bar 1 // expected-error {{user-defined suffix cannot be used here}}
8 #ident "foo"_bar // expected-error {{user-defined suffix cannot be used here}}
9 _Pragma("foo"_bar) // expected-error {{user-defined suffix cannot be used here}}
10 #pragma comment(lib, "foo"_bar) // expected-error {{user-defined suffix cannot be used here}}
11 _Pragma("comment(lib, \"foo\"_bar)") // expected-error {{user-defined suffix cannot be used here}}
12 #pragma message "hi"_there // expected-error {{user-defined suffix cannot be used here}} expected-warning {{hi}}
13 #pragma push_macro("foo"_bar) // expected-error {{user-defined suffix cannot be used here}}
14 #if __has_warning("-Wan-island-to-discover"_bar) // expected-error {{user-defined suffix cannot be used here}}
15 #elif __has_include("foo"_bar) // expected-error {{expected "FILENAME" or <FILENAME>}}
18 extern "C++"_x {} // expected-error {{user-defined suffix cannot be used here}}
21 asm("mov %eax, %rdx"_foo); // expected-error {{user-defined suffix cannot be used here}}
24 static_assert(true, "foo"_bar); // expected-error {{no matching literal operator for call to 'operator""_bar'}}
25 // expected-warning@-1 {{'static_assert' with a user-generated message is a C++26 extension}}
27 int cake() __attribute__((availability(macosx, unavailable, message = "is a lie"_x))); // expected-error {{user-defined suffix cannot be used here}}
29 // A ud-suffix cannot be used on character literals in preprocessor constant
31 #if 'x'_y - u'x'_z // expected-error 2{{character literal with user-defined suffix cannot be used in preprocessor constant expression}}
35 // A ud-suffix cannot be used on integer literals in preprocessor constant
37 #if 0_foo // expected-error {{integer literal with user-defined suffix cannot be used in preprocessor constant expression}}
81 _no_such_suffix // expected-error {{'operator""_no_such_suffix'}}
87 _no_such_suffix; // expected-error {{'operator""_no_such_suffix'}}
91 _no_such_suffix; // expected-error {{'operator""_no_such_suffix'}}
95 _no_such_suffix; // expected-error {{'operator""_no_such_suffix'}}
101 // expected-warning@-1{{identifier '_foo' preceded by whitespace in a literal operator declaration is deprecated}}
104 // expected-warning@-1{{identifier '_foo' preceded by whitespace in a literal operator declaration is deprecated}}
107 // expected-warning@-1{{identifier '_foo' preceded by whitespace}}
112 void operator "\0"_non_empty(const char *); // expected-error {{must be '""'}}
113 void operator L""_not_char(const char *); // expected-error {{cannot have an encoding prefix}}
115 U"" // expected-error {{cannot have an encoding prefix}}
117 void operator "" u8"" "\u0123" "hello"_all_of_the_things ""(const char*); // expected-error {{must be '""'}}
119 // Make sure we treat UCNs and UTF-8 as equivalent.
120 int operator""_µs(unsigned long long) {} // expected-note {{previous}}
122 int operator""_\u00b5s(unsigned long long) {} // expected-error {{redefinition of 'operator""_µs'}}
124 int operator""_\U0000212B(long double) {} // expected-note {{previous}}
126 int operator""_Å(long double) {} // expected-error {{redefinition of 'operator""_Å'}}
128 int operator""_𐀀(char) {} // expected-note {{previous}}
130 int operator""_\U00010000(char) {} // expected-error {{redefinition of 'operator""_𐀀'}}
142 void operator""_℮""_ℯ(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
143 void operator""_℮""_\u212f(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
144 void operator""_\u212e""_ℯ(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
145 void operator""_\u212e""_\u212f(unsigned long long) {} // expected-error {{differing user-defined suffixes ('_℮' and '_ℯ') in string literal concatenation}}
147 void operator""_℮""_℮(unsigned long long) {} // expected-note {{previous}}
148 void operator""_\u212e""_\u212e(unsigned long long) {} // expected-error {{redefinition}}
150 #define ¢ *0.01 // expected-error {{macro name must be an identifier}}
151 constexpr int operator""_¢(long double d) { return d * 100; } // expected-error {{character <U+00A2> not allowed in an identifier}}
152 constexpr int operator""_¢(unsigned long long n) { return n; } // expected-error {{character <U+00A2> not allowed in an identifier}}
153 static_assert(0.02_¢ == 2_¢, ""); // expected-error 2{{character <U+00A2> not allowed in an identifier}}