[cfe-commits] r54033 - in /cfe/trunk: lib/AST/Expr.cpp test/Sema/exprs.c
Chris Lattner
sabre at nondot.org
Fri Jul 25 11:07:21 PDT 2008
Author: lattner
Date: Fri Jul 25 13:07:19 2008
New Revision: 54033
URL: http://llvm.org/viewvc/llvm-project?rev=54033&view=rev
Log:
Add support for __extension__ as an lvalue. rdar://6097308
Modified:
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/test/Sema/exprs.c
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=54033&r1=54032&r2=54033&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Fri Jul 25 13:07:19 2008
@@ -415,7 +415,8 @@
return LV_Valid; // C99 6.5.3p4
if (cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Real ||
- cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Imag)
+ cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Imag ||
+ cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Extension)
return cast<UnaryOperator>(this)->getSubExpr()->isLvalue(); // GNU.
break;
case ParenExprClass: // C99 6.5.1p5
Modified: cfe/trunk/test/Sema/exprs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/exprs.c?rev=54033&r1=54032&r2=54033&view=diff
==============================================================================
--- cfe/trunk/test/Sema/exprs.c (original)
+++ cfe/trunk/test/Sema/exprs.c Fri Jul 25 13:07:19 2008
@@ -9,3 +9,9 @@
return 1.0if; // expected-warning {{imaginary constants are an extension}}
}
+// rdar://6097308
+void test3() {
+ int x;
+ (__extension__ x) = 10;
+}
+
More information about the cfe-commits
mailing list