summaryrefslogtreecommitdiffstats
path: root/clang/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
commit049bdcac498f059d721f3dc035525b8d7cbe2fbd (patch)
tree79f598874ea78b54ff9ea42fbb7af6e3e5a8c676 /clang/lib/AST/DeclPrinter.cpp
parent04bc01833e876ab4cec316b2b77be94e61b785b3 (diff)
downloadbcm5719-llvm-049bdcac498f059d721f3dc035525b8d7cbe2fbd.tar.gz
bcm5719-llvm-049bdcac498f059d721f3dc035525b8d7cbe2fbd.zip
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. llvm-svn: 90863
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 2c3b927e436..adf7ed3b0e2 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/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)) {
OpenPOWER on IntegriCloud