Teach -ast-print how to print trailing-return-types.

llvm-svn: 175864
This commit is contained in:
Richard Smith 2013-02-22 05:54:51 +00:00
parent efb41d23a6
commit e6560761ce
2 changed files with 7 additions and 4 deletions

View File

@ -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);
}

View File

@ -1,7 +1,6 @@
// RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s
// FIXME: Print the trailing-return-type properly.
// CHECK: decltype(nullptr) operator "" _foo(const char *p, decltype(sizeof(int)));
// CHECK: auto operator "" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
auto operator"" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
// CHECK: decltype(""_foo) operator "" _bar(unsigned long long);