summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/asm.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-06 03:21:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-06 03:21:47 +0000
commitd67aea28f6cb180291f95690ece485740f3fe859 (patch)
tree9d4fa42ed4f930bbeeca769b01d37778b2f8e9ec /clang/test/Parser/asm.cpp
parent8de07444410eb8e56e1799cd9b1244cdb81e0142 (diff)
downloadbcm5719-llvm-d67aea28f6cb180291f95690ece485740f3fe859.tar.gz
bcm5719-llvm-d67aea28f6cb180291f95690ece485740f3fe859.zip
User-defined literals: reject string and character UDLs in all places where the
grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. llvm-svn: 152098
Diffstat (limited to 'clang/test/Parser/asm.cpp')
-rw-r--r--clang/test/Parser/asm.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Parser/asm.cpp b/clang/test/Parser/asm.cpp
new file mode 100644
index 00000000000..35a497c83a1
--- /dev/null
+++ b/clang/test/Parser/asm.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+
+int foo1 asm ("bar1");
+int foo2 asm (L"bar2"); // expected-error {{cannot use wide string literal in 'asm'}}
+int foo3 asm (u8"bar3"); // expected-error {{cannot use unicode string literal in 'asm'}}
+int foo4 asm (u"bar4"); // expected-error {{cannot use unicode string literal in 'asm'}}
+int foo5 asm (U"bar5"); // expected-error {{cannot use unicode string literal in 'asm'}}
+int foo6 asm ("bar6"_x); // expected-error {{string literal with user-defined suffix cannot be used here}}
OpenPOWER on IntegriCloud