aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclPrinter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-08 17:45:32 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-08 17:45:32 +0000
commit0ae7b3f1d5403265f693ed75384603ca8fbba74d (patch)
tree5551031460d1b0cdb7ad8a752c21d21f239e265f /lib/AST/DeclPrinter.cpp
parent7b682656310b0d7e94a98d982444bc7ddedc653f (diff)
Implement template instantiation for exception specifications. Also,
print exception specifications on function types and declarations. Fixes <rdar://problem/7450999>. There is some poor source-location information here, because we don't track locations of the types in exception specifications. Filed PR5719. Failures during template instantiation of the signature of a function or function template have wrong point-of-instantiation location information. I'll tackle that with a separate commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclPrinter.cpp')
-rw-r--r--lib/AST/DeclPrinter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index 2c3b927e43..adf7ed3b0e 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -361,6 +361,24 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
}
Proto += ")";
+
+ if (FT && FT->hasExceptionSpec()) {
+ Proto += " throw(";
+ if (FT->hasAnyExceptionSpec())
+ Proto += "...";
+ else
+ for (unsigned I = 0, N = FT->getNumExceptions(); I != N; ++I) {
+ if (I)
+ Proto += ", ";
+
+
+ std::string ExceptionType;
+ FT->getExceptionType(I).getAsStringInternal(ExceptionType, SubPolicy);
+ Proto += ExceptionType;
+ }
+ Proto += ")";
+ }
+
if (D->hasAttr<NoReturnAttr>())
Proto += " __attribute((noreturn))";
if (CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D)) {