[cfe-commits] r47269 - in /cfe/trunk: AST/Expr.cpp test/Sema/deref.c
Steve Naroff
snaroff at apple.com
Mon Feb 18 07:14:59 PST 2008
Author: snaroff
Date: Mon Feb 18 09:14:59 2008
New Revision: 47269
URL: http://llvm.org/viewvc/llvm-project?rev=47269&view=rev
Log:
Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.
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=47269&r1=47268&r2=47269&view=diff
==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Mon Feb 18 09:14:59 2008
@@ -358,7 +358,7 @@
return LV_NotObjectType;
// Allow qualified void which is an incomplete type other than void (yuck).
- if (TR->isVoidType() && !TR.getQualifiers())
+ if (TR->isVoidType() && !TR.getCanonicalType().getQualifiers())
return LV_IncompleteVoidType;
if (TR->isReferenceType()) // C++ [expr]
Modified: cfe/trunk/test/Sema/deref.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/deref.c?rev=47269&r1=47268&r2=47269&view=diff
==============================================================================
--- cfe/trunk/test/Sema/deref.c (original)
+++ cfe/trunk/test/Sema/deref.c Mon Feb 18 09:14:59 2008
@@ -21,6 +21,7 @@
}
extern const void cv1;
+
const void *foo4 (void)
{
return &cv1;
@@ -31,3 +32,12 @@
{
return &cv2; // expected-error{{address expression must be an lvalue or a function designator}}
}
+
+typedef const void CVT;
+extern CVT cv3;
+
+const void *foo6 (void)
+{
+ return &cv3;
+}
+
More information about the cfe-commits
mailing list