[cfe-commits] r46917 - in /cfe/trunk: AST/Expr.cpp test/Sema/deref.c
Steve Naroff
snaroff at apple.com
Sat Feb 9 16:30:18 PST 2008
Author: snaroff
Date: Sat Feb 9 18:30:18 2008
New Revision: 46917
URL: http://llvm.org/viewvc/llvm-project?rev=46917&view=rev
Log:
Change Expr::isLvalue() to allow the "void" type. This fixes bz2000 submitted by Neil Booth.
Neil, can you point me to the place in the C99 spec that says this is allowed? I thought Expr::isLvalue() conformed to the spec, which says "C99 6.3.2.1: an lvalue is an expression with an object type or an incomplete type other than void.". Please advise.
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=46917&r1=46916&r2=46917&view=diff
==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Sat Feb 9 18:30:18 2008
@@ -357,9 +357,6 @@
if (TR->isFunctionType()) // from isObjectType()
return LV_NotObjectType;
- if (TR->isVoidType())
- 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=46917&r1=46916&r2=46917&view=diff
==============================================================================
--- cfe/trunk/test/Sema/deref.c (original)
+++ cfe/trunk/test/Sema/deref.c Sat Feb 9 18:30:18 2008
@@ -17,6 +17,12 @@
void foo3 (void)
{
void* x = 0;
- void* y = &*x; // expected-error {{address expression must be an lvalue or a function designator}}
+ void* y = &*x;
+}
+
+extern const void cv1;
+const void *foo4 (void)
+{
+ return &cv1;
}
More information about the cfe-commits
mailing list