diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-10-29 00:13:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-10-29 00:13:59 +0000 |
commit | 8e1cf608dc587c266d32b151a5f209010e29e249 (patch) | |
tree | 177da3462880cff330d46c89ae8c7504eb4add2c /clang/lib/Sema/SemaChecking.cpp | |
parent | cc2045534623f86869933b5288bc8dc2745bf92c (diff) | |
download | bcm5719-llvm-8e1cf608dc587c266d32b151a5f209010e29e249.tar.gz bcm5719-llvm-8e1cf608dc587c266d32b151a5f209010e29e249.zip |
Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:
- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).
We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.
llvm-svn: 58353
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index ac41bfc431d..816d6fd05d6 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -886,7 +886,7 @@ static DeclRefExpr* EvalVal(Expr *E) { DeclRefExpr *DR = cast<DeclRefExpr>(E); if (VarDecl *V = dyn_cast<VarDecl>(DR->getDecl())) - if(V->hasLocalStorage()) return DR; + if(V->hasLocalStorage() && !V->getType()->isReferenceType()) return DR; return NULL; } |