diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-05 22:19:06 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-05 22:19:06 +0000 |
commit | 65bcdabba34fddc303ab97f60dfea6079989306a (patch) | |
tree | 173c25e2dd1bbfb190a253f8d25409190d546f7a /lib | |
parent | ca952281611205fbc36d0516a595f9751e071d36 (diff) |
In DeclPrint add printing of 'explicit'
constructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 95d56b69d7..a5e1378b46 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -397,6 +397,7 @@ void DeclPrinter::VisitEnumConstantDecl(EnumConstantDecl *D) { } void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { + CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D); if (!Policy.SuppressSpecifiers) { switch (D->getStorageClassAsWritten()) { case SC_None: break; @@ -410,6 +411,8 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { if (D->isInlineSpecified()) Out << "inline "; if (D->isVirtualAsWritten()) Out << "virtual "; if (D->isModulePrivate()) Out << "__module_private__ "; + if (CDecl && CDecl->isExplicitSpecified()) + Out << "explicit "; } PrintingPolicy SubPolicy(Policy); @@ -485,7 +488,7 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { } } - if (CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D)) { + if (CDecl) { bool HasInitializerList = false; for (CXXConstructorDecl::init_const_iterator B = CDecl->init_begin(), E = CDecl->init_end(); |