summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-04-30 19:20:55 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-04-30 19:20:55 +0000
commitaae83b4596445d0850b2407aa4d9ccf6f414ad1d (patch)
tree89911f5f52202f8f7a870b0fe7d7da2c83f468ba /clang/lib/Sema
parent2acb5adac95e5e5d8dbbd88f6312ad8bd4a46367 (diff)
downloadbcm5719-llvm-aae83b4596445d0850b2407aa4d9ccf6f414ad1d.tar.gz
bcm5719-llvm-aae83b4596445d0850b2407aa4d9ccf6f414ad1d.zip
Make a home for exception specs in the AST. Now Sema can hook them up.
llvm-svn: 70506
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp1
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 9e2bd444f85..2381c62575a 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -714,6 +714,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
(OldProto = dyn_cast<FunctionProtoType>(OldFuncType))) {
// The old declaration provided a function prototype, but the
// new declaration does not. Merge in the prototype.
+ assert(!OldProto->hasExceptionSpec() && "Exception spec in C");
llvm::SmallVector<QualType, 16> ParamTypes(OldProto->arg_type_begin(),
OldProto->arg_type_end());
NewQType = Context.getFunctionType(NewFuncType->getResultType(),
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 71d2f80cfc4..e9b7fb04ceb 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -995,6 +995,9 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
QualType ClassType = Context.getTypeDeclType(ClassDecl);
ClassType = Context.getCanonicalType(ClassType);
+ // FIXME: Implicit declarations have exception specifications, which are
+ // the union of the specifications of the implicitly called functions.
+
if (!ClassDecl->hasUserDeclaredConstructor()) {
// C++ [class.ctor]p5:
// A default constructor for a class X is a constructor of class X
OpenPOWER on IntegriCloud