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 | 27c8dc06f65d7abcf6a7e7f64a7960c9a150ca01 (patch) | |
tree | 11c0cafe9243e679b669258afcbf41260033c7be /lib/Sema/SemaChecking.cpp | |
parent | 1b450b092a053896e96f0355cf7c7cdc9bba9eab (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index ac41bfc431..816d6fd05d 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/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; } |