diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-02-21 20:05:19 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-02-21 20:05:19 +0000 |
commit | 483b9f3bc05c5409e2c6643f1c9d91e21c8ff9d2 (patch) | |
tree | 98392cc5b1045b5eab9c827e4e1ba7cc48e2cc9a /lib/Sema/SemaExpr.cpp | |
parent | 57cbb0de091a05a6510f0a7278ee8da57a4d27fc (diff) |
Tweaks to C++0x deduced auto type support:
* Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
* Temporary template parameter list for auto deduction is now allocated on the stack.
* Deduced 'auto' types are now uniqued.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index e7d167ed38..4ac3538764 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -76,12 +76,10 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, } // See if this is an auto-typed variable whose initializer we are parsing. - if (const VarDecl *VD = dyn_cast<VarDecl>(D)) { - if (VD->isParsingAutoInit()) { - Diag(Loc, diag::err_auto_variable_cannot_appear_in_own_initializer) - << D->getDeclName(); - return true; - } + if (ParsingInitForAutoVars.count(D)) { + Diag(Loc, diag::err_auto_variable_cannot_appear_in_own_initializer) + << D->getDeclName(); + return true; } // See if the decl is deprecated. |