================
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -std=c++11 -Wno-user-defined-literals -verify=expected %s
+// RUN: %clang_cc1 -std=c++11 -Wno-user-defined-literals -verify=no_dollar 
-fno-dollars-in-identifiers %s
+
+// expected-no-diagnostics
+
+int $;  // no_dollar-error {{expected unqualified-id}}
+int $$; // no_dollar-error {{expected unqualified-id}}
+int Σ$; // no_dollar-error {{expected ';' after top level declarator}}
+int $Σ; // no_dollar-error {{expected unqualified-id}}
+
+using size_t = decltype(sizeof(void *));
+
+int operator"" $(const char *p, size_t n);  // no_dollar-error {{expected 
identifier}}
+int operator"" $$(const char *p, size_t n); // no_dollar-error {{expected 
identifier}}
+int operator"" Σ$(const char *p, size_t n); // no_dollar-error {{'operator""Σ' 
cannot be the name of a variable or data member}} \
+                                                          // no_dollar-error 
{{expected ';' after top level declarator}}
+int operator"" $Σ(const char *p, size_t n); // no_dollar-error {{expected 
identifier}}
+int operator"" Σ(const char *p, size_t n);
----------------
AaronBallman wrote:

Should we add a test that the UDL with the dollar sign can be used on a literal 
and behaves how you'd expect?

https://github.com/llvm/llvm-project/pull/208490
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to