Always build a builtin operator expression for the __extension__ unary operator.

llvm-svn: 88811
This commit is contained in:
Anders Carlsson 2009-11-14 21:26:41 +00:00
parent 50cb321fdc
commit 461a2c0640
2 changed files with 5 additions and 1 deletions

View File

@ -5711,7 +5711,8 @@ Action::OwningExprResult Sema::BuildUnaryOp(Scope *S, SourceLocation OpLoc,
UnaryOperator::Opcode Opc,
ExprArg input) {
Expr *Input = (Expr*)input.get();
if (getLangOptions().CPlusPlus && Input->getType()->isOverloadableType()) {
if (getLangOptions().CPlusPlus && Input->getType()->isOverloadableType() &&
Opc != UnaryOperator::Extension) {
// Find all of the overloaded operators visible from this
// point. We perform both an operator-name lookup from the local
// scope and an argument-dependent lookup based on the types of

View File

@ -185,3 +185,6 @@ int test_pr5432() {
return a[X][X];
}
void f() {
(void)__extension__(A());
}