summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 05:54:51 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 05:54:51 +0000
commite6560761ced83883627cf1e441feed5e4b61848e (patch)
tree5ba29dca9e93ca8f180559d34c8af59dbb08e8f0 /clang/lib/AST/DeclPrinter.cpp
parentefb41d23a6108341b14f39c75ddc407efc329b97 (diff)
downloadbcm5719-llvm-e6560761ced83883627cf1e441feed5e4b61848e.tar.gz
bcm5719-llvm-e6560761ced83883627cf1e441feed5e4b61848e.zip
Teach -ast-print how to print trailing-return-types.
llvm-svn: 175864
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 333e321d407..dce4f9af258 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -542,9 +542,13 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
}
if (!Proto.empty())
Out << Proto;
- }
- else
+ } else {
+ if (FT && FT->hasTrailingReturn()) {
+ Out << "auto " << Proto << " -> ";
+ Proto.clear();
+ }
AFT->getResultType().print(Out, Policy, Proto);
+ }
} else {
Ty.print(Out, Policy, Proto);
}
OpenPOWER on IntegriCloud