diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-03 17:10:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-03 17:10:37 +0000 |
commit | 1f5f3a4d58a1c7c50c331b33329fc14563533c04 (patch) | |
tree | 2d7ddc42b24dc1655f44ed29ebdacc97efc484d4 /lib/Sema/SemaType.cpp | |
parent | 109ae73ec71a1d27358510ce049b59637b4a6b40 (diff) |
When we're building a CXXExprWithTemporaries, only include those
temporaries that are within our current evaluation context. That way,
nested evaluation contexts (e.g., within a sizeof() expression) won't
see temporaries from outer contexts. Also, make sure to push a new
evaluation context when instantiating the initializer of a variable;
this may be an unevaluated context or a potentially-evaluated context,
depending on whether it's an in-class initializer or not. Fixes PR5672.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index afce5e33ba..526ab91e9f 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -897,6 +897,9 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, break; } + if (T.isNull()) + return T; + if (T == Context.UndeducedAutoTy) { int Error = -1; |