Sema: Permit array l-values in asm output operands
GCC permits array l-values in asm output operands even though they aren't modifiable l-values. We used to permit it but this behavior regressed in r224916. llvm-svn: 224918
This commit is contained in:
parent
e86c8c807f
commit
04b78412ad
|
@ -156,6 +156,9 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
|
|||
case Expr::MLV_Valid:
|
||||
// Cool, this is an lvalue.
|
||||
break;
|
||||
case Expr::MLV_ArrayType:
|
||||
// This is OK too.
|
||||
break;
|
||||
case Expr::MLV_LValueCast: {
|
||||
const Expr *LVal = OutputExpr->IgnoreParenNoopCasts(Context);
|
||||
if (!getLangOpts().HeinousExtensions) {
|
||||
|
|
|
@ -30,3 +30,7 @@ void test4(int) { // expected-note{{possible target for call}}
|
|||
// expected-error@+1{{overloaded function could not be resolved}}
|
||||
__asm__ ("":"+r" (test4)); // expected-error{{invalid lvalue in asm output}}
|
||||
}
|
||||
void test5() {
|
||||
char buf[1];
|
||||
__asm__ ("":"+r" (buf));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue