aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-01-05 22:34:08 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-01-05 22:34:08 +0000
commit6aeaa60217e1ed11a621409acf1b53df0d14b591 (patch)
tree1289786b43b7d0df3be63a11d7abd8c64e2b1383 /lib/Sema/SemaTemplateInstantiateDecl.cpp
parent1c7946a9fbba8671cc57f7dfd00721f8c035f913 (diff)
Tweak the fix to PR8977: an empty expression-list represents value initialization, not default initialization. Fixes PR11712.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 1f87983805..00addc2d83 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -393,16 +393,15 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
if (!SemaRef.InstantiateInitializer(D->getInit(), TemplateArgs, LParenLoc,
InitArgs, RParenLoc)) {
bool TypeMayContainAuto = true;
- // Attach the initializer to the declaration, if we have one.
- if (InitArgs.size() == 0)
- SemaRef.ActOnUninitializedDecl(Var, TypeMayContainAuto);
- else if (D->hasCXXDirectInitializer()) {
+ if (D->hasCXXDirectInitializer()) {
// Add the direct initializer to the declaration.
SemaRef.AddCXXDirectInitializerToDecl(Var,
LParenLoc,
move_arg(InitArgs),
RParenLoc,
TypeMayContainAuto);
+ } else if (InitArgs.size() == 0) {
+ SemaRef.ActOnUninitializedDecl(Var, TypeMayContainAuto);
} else {
assert(InitArgs.size() == 1);
Expr *Init = InitArgs.take()[0];