aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AST/Expr.cpp3
-rw-r--r--test/Sema/deref.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/AST/Expr.cpp b/AST/Expr.cpp
index f02e817f06..f979c7aa7b 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -357,9 +357,6 @@ Expr::isLvalueResult Expr::isLvalue() const {
if (TR->isFunctionType()) // from isObjectType()
return LV_NotObjectType;
- if (TR->isVoidType())
- return LV_IncompleteVoidType;
-
if (TR->isReferenceType()) // C++ [expr]
return LV_Valid;
diff --git a/test/Sema/deref.c b/test/Sema/deref.c
index 7441584107..7efb55e720 100644
--- a/test/Sema/deref.c
+++ b/test/Sema/deref.c
@@ -17,6 +17,12 @@ void foo2 (void)
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;
}