diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-08 17:45:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-08 17:45:32 +0000 |
commit | 049bdcac498f059d721f3dc035525b8d7cbe2fbd (patch) | |
tree | 79f598874ea78b54ff9ea42fbb7af6e3e5a8c676 /clang/lib/AST/DeclPrinter.cpp | |
parent | 04bc01833e876ab4cec316b2b77be94e61b785b3 (diff) | |
download | bcm5719-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.cpp | 18 |
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)) { |