[cfe-commits] r46919 - in /cfe/trunk: AST/Expr.cpp test/Sema/deref.c
Steve Naroff
snaroff at apple.com
Sat Feb 9 17:39:04 PST 2008
Author: snaroff
Date: Sat Feb 9 19:39:04 2008
New Revision: 46919
URL: http://llvm.org/viewvc/llvm-project?rev=46919&view=rev
Log:
Refine bug fix to Expr::isLvalue (commit r46917).
Modified:
cfe/trunk/AST/Expr.cpp
cfe/trunk/test/Sema/deref.c
Modified: cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Expr.cpp?rev=46919&r1=46918&r2=46919&view=diff
==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Sat Feb 9 19:39:04 2008
@@ -357,6 +357,10 @@
if (TR->isFunctionType()) // from isObjectType()
return LV_NotObjectType;
+ // Allow qualified void which is an incomplete type other than void (yuck).
+ if (TR->isVoidType() && !TR.getQualifiers())
+ return LV_IncompleteVoidType;
+
if (TR->isReferenceType()) // C++ [expr]
return LV_Valid;
Modified: cfe/trunk/test/Sema/deref.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/deref.c?rev=46919&r1=46918&r2=46919&view=diff
==============================================================================
--- cfe/trunk/test/Sema/deref.c (original)
+++ cfe/trunk/test/Sema/deref.c Sat Feb 9 19:39:04 2008
@@ -17,7 +17,7 @@
void foo3 (void)
{
void* x = 0;
- void* y = &*x;
+ void* y = &*x; // expected-error{{address expression must be an lvalue or a function designator}}
}
extern const void cv1;
@@ -26,3 +26,8 @@
return &cv1;
}
+extern void cv2;
+void *foo5 (void)
+{
+ return &cv2; // expected-error{{address expression must be an lvalue or a function designator}}
+}
More information about the cfe-commits
mailing list