summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-14 23:15:26 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-14 23:15:26 +0000
commit3fa58d1f63e06cecee8280160a984b5fae28c67e (patch)
tree3ee9096ae2536aa9885661ee957e97cc8c3a572c /clang/lib/Sema/SemaExpr.cpp
parent6010da024cec6cf301c2b41a4bff10c70f7643bf (diff)
downloadbcm5719-llvm-3fa58d1f63e06cecee8280160a984b5fae28c67e.tar.gz
bcm5719-llvm-3fa58d1f63e06cecee8280160a984b5fae28c67e.zip
Diagnose taking the address of a bit-field inside a conditional operator.
llvm-svn: 81808
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 1c5d19748f8..7835523062a 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -5062,6 +5062,10 @@ QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) {
Diag(OpLoc, diag::err_typecheck_address_of)
<< "property expression" << op->getSourceRange();
return QualType();
+ } else if (ConditionalOperator *CO = dyn_cast<ConditionalOperator>(op)) {
+ // FIXME: Can LHS ever be null here?
+ if (!CheckAddressOfOperand(CO->getLHS(), OpLoc).isNull())
+ return CheckAddressOfOperand(CO->getRHS(), OpLoc);
} else if (dcl) { // C99 6.5.3.2p1
// We have an lvalue with a decl. Make sure the decl is not declared
// with the register storage-class specifier.
OpenPOWER on IntegriCloud