summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-17 22:52:20 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-17 22:52:20 +0000
commit19b8c4fffac3fad4368e751aae0d90f5f65ffb77 (patch)
treec55648dad0c823eff9fdd8b1965d20b43752f325 /clang/lib/Sema/SemaExpr.cpp
parent90ba91574ab52f5ce08ea24c2b80fbd3f69018a5 (diff)
downloadbcm5719-llvm-19b8c4fffac3fad4368e751aae0d90f5f65ffb77.tar.gz
bcm5719-llvm-19b8c4fffac3fad4368e751aae0d90f5f65ffb77.zip
Delay semantic analysis of the C++ names casts when the subexpression is type-dependent or the destination type is dependent.
llvm-svn: 61165
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 515169c557e..096bcbe37b0 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -2876,6 +2876,9 @@ static NamedDecl *getPrimaryDecl(Expr *E) {
/// In C++, the operand might be an overloaded function name, in which case
/// we allow the '&' but retain the overloaded-function type.
QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) {
+ if (op->isTypeDependent())
+ return Context.DependentTy;
+
if (getLangOptions().C99) {
// Implement C99-only parts of addressof rules.
if (UnaryOperator* uOp = dyn_cast<UnaryOperator>(op)) {
OpenPOWER on IntegriCloud