Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 9defcca..767da87 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -2174,7 +2174,10 @@
       CXXConstructorDecl::Create(Context, ClassDecl,
                                  ClassDecl->getLocation(), Name,
                                  Context.getFunctionType(Context.VoidTy,
-                                                         0, 0, false, 0),
+                                                         0, 0, false, 0,
+                                                         /*FIXME*/false, false,
+                                                         0, 0, false,
+                                                         CC_Default),
                                  /*TInfo=*/0,
                                  /*isExplicit=*/false,
                                  /*isInline=*/true,
@@ -2246,7 +2249,10 @@
                                    ClassDecl->getLocation(), Name,
                                    Context.getFunctionType(Context.VoidTy,
                                                            &ArgType, 1,
-                                                           false, 0),
+                                                           false, 0,
+                                                           /*FIXME:*/false,
+                                                           false, 0, 0, false,
+                                                           CC_Default),
                                    /*TInfo=*/0,
                                    /*isExplicit=*/false,
                                    /*isInline=*/true,
@@ -2332,7 +2338,10 @@
     CXXMethodDecl *CopyAssignment =
       CXXMethodDecl::Create(Context, ClassDecl, ClassDecl->getLocation(), Name,
                             Context.getFunctionType(RetType, &ArgType, 1,
-                                                    false, 0),
+                                                    false, 0,
+                                                    /*FIXME:*/false,
+                                                    false, 0, 0, false,
+                                                    CC_Default),
                             /*TInfo=*/0, /*isStatic=*/false, /*isInline=*/true);
     CopyAssignment->setAccess(AS_public);
     CopyAssignment->setImplicit();
@@ -2364,7 +2373,10 @@
       = CXXDestructorDecl::Create(Context, ClassDecl,
                                   ClassDecl->getLocation(), Name,
                                   Context.getFunctionType(Context.VoidTy,
-                                                          0, 0, false, 0),
+                                                          0, 0, false, 0,
+                                                           /*FIXME:*/false,
+                                                           false, 0, 0, false,
+                                                           CC_Default),
                                   /*isInline=*/true,
                                   /*isImplicitlyDeclared=*/true);
     Destructor->setAccess(AS_public);
@@ -2523,7 +2535,13 @@
   const FunctionProtoType *Proto = R->getAs<FunctionProtoType>();
   return Context.getFunctionType(Context.VoidTy, Proto->arg_type_begin(),
                                  Proto->getNumArgs(),
-                                 Proto->isVariadic(), 0);
+                                 Proto->isVariadic(), 0,
+                                 Proto->hasExceptionSpec(),
+                                 Proto->hasAnyExceptionSpec(),
+                                 Proto->getNumExceptions(),
+                                 Proto->exception_begin(),
+                                 Proto->getNoReturnAttr(),
+                                 Proto->getCallConv());
 }
 
 /// CheckConstructor - Checks a fully-formed constructor for
@@ -2680,7 +2698,9 @@
   // "void" as the return type, since destructors don't have return
   // types. We *always* have to do this, because GetTypeForDeclarator
   // will put in a result type of "int" when none was specified.
-  return Context.getFunctionType(Context.VoidTy, 0, 0, false, 0);
+  // FIXME: Exceptions!
+  return Context.getFunctionType(Context.VoidTy, 0, 0, false, 0,
+                                 false, false, 0, 0, false, CC_Default);
 }
 
 /// CheckConversionDeclarator - Called by ActOnDeclarator to check the
@@ -2749,8 +2769,15 @@
   // Rebuild the function type "R" without any parameters (in case any
   // of the errors above fired) and with the conversion type as the
   // return type.
+  const FunctionProtoType *Proto = R->getAs<FunctionProtoType>();
   R = Context.getFunctionType(ConvType, 0, 0, false,
-                              R->getAs<FunctionProtoType>()->getTypeQuals());
+                              Proto->getTypeQuals(),
+                              Proto->hasExceptionSpec(),
+                              Proto->hasAnyExceptionSpec(),
+                              Proto->getNumExceptions(),
+                              Proto->exception_begin(),
+                              Proto->getNoReturnAttr(),
+                              Proto->getCallConv());
 
   // C++0x explicit conversion operators.
   if (D.getDeclSpec().isExplicitSpecified() && !getLangOptions().CPlusPlus0x)