diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2020-01-08 08:38:02 -0500 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2020-01-08 08:38:02 -0500 |
commit | 55a51e1c79a21080289ba88d5eac4bbe54ec4272 (patch) | |
tree | 00462bdab74ef9ee3b5ee04490d71f5449090202 /clang/lib/Parse/ParseDecl.cpp | |
parent | 111ec8c2a435440a72904aeca22c9f3046de5f42 (diff) | |
download | llvm-55a51e1c79a21080289ba88d5eac4bbe54ec4272.zip llvm-55a51e1c79a21080289ba88d5eac4bbe54ec4272.tar.gz llvm-55a51e1c79a21080289ba88d5eac4bbe54ec4272.tar.bz2 |
Disallow an empty string literal in an asm label
An empty string literal in an asm label does not make a whole lot of sense. GCC
does not diagnose such a construct, but it also generates code that cannot be
assembled by gas should two symbols have an empty asm label within the same TU.
This does not affect an asm statement with an empty string literal, which is
still a useful construct.
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index a90147c..514a2ed 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -2197,7 +2197,7 @@ bool Parser::ParseAsmAttributesAfterDeclarator(Declarator &D) { // If a simple-asm-expr is present, parse it. if (Tok.is(tok::kw_asm)) { SourceLocation Loc; - ExprResult AsmLabel(ParseSimpleAsm(&Loc)); + ExprResult AsmLabel(ParseSimpleAsm(/*ForAsmLabel*/ true, &Loc)); if (AsmLabel.isInvalid()) { SkipUntil(tok::semi, StopBeforeMatch); return true; |