diff options
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 4 | ||||
-rw-r--r-- | test/SemaCXX/ast-print.cpp | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 45280df812..386ad66c99 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -629,13 +629,13 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { ImplicitInit = D->getInitStyle() == VarDecl::CallInit && Construct->getNumArgs() == 0 && !Construct->isListInitialization(); if (!ImplicitInit) { - if (D->getInitStyle() == VarDecl::CallInit) + if ((D->getInitStyle() == VarDecl::CallInit) && !isa<ParenListExpr>(Init)) Out << "("; else if (D->getInitStyle() == VarDecl::CInit) { Out << " = "; } Init->printPretty(Out, 0, Policy, Indentation); - if (D->getInitStyle() == VarDecl::CallInit) + if ((D->getInitStyle() == VarDecl::CallInit) && !isa<ParenListExpr>(Init)) Out << ")"; } } diff --git a/test/SemaCXX/ast-print.cpp b/test/SemaCXX/ast-print.cpp index 5e89c8b548..e0c154a0ec 100644 --- a/test/SemaCXX/ast-print.cpp +++ b/test/SemaCXX/ast-print.cpp @@ -52,3 +52,11 @@ void test6() { unsigned int y = 0; test6fn((int&)y); } + +// CHECK: S s( 1, 2 ); + +template <class S> void test7() +{ + S s( 1,2 ); +} + |