]> granicus.if.org Git - clang/commitdiff
Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.
authorSteve Naroff <snaroff@apple.com>
Mon, 18 Feb 2008 15:14:59 +0000 (15:14 +0000)
committerSteve Naroff <snaroff@apple.com>
Mon, 18 Feb 2008 15:14:59 +0000 (15:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47269 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp
test/Sema/deref.c

index 720b490d2421309260705e22fa3c79e09dbca492..27dfa78273bafebeef1152b78b1c937ded47d136 100644 (file)
@@ -358,7 +358,7 @@ Expr::isLvalueResult Expr::isLvalue() const {
     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]
index 8f8156d81f70c7be223cf5a8bc382c0cbfa47834..83f7f8389cd249d1f2cd5708746722ba9e472de3 100644 (file)
@@ -21,6 +21,7 @@ void foo3 (void)
 }
 
 extern const void cv1;
+
 const void *foo4 (void)
 {
   return &cv1;
@@ -31,3 +32,12 @@ void *foo5 (void)
 {
   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;
+}
+