Disallow exception specs on typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72664 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp
index f3ff0c6..d8c6986 100644
--- a/lib/Parse/DeclSpec.cpp
+++ b/lib/Parse/DeclSpec.cpp
@@ -33,6 +33,7 @@
                                              unsigned NumArgs,
                                              unsigned TypeQuals,
                                              bool hasExceptionSpec,
+                                             SourceLocation ThrowLoc,
                                              bool hasAnyExceptionSpec,
                                              ActionBase::TypeTy **Exceptions,
                                              SourceRange *ExceptionRanges,
@@ -50,6 +51,7 @@
   I.Fun.NumArgs          = NumArgs;
   I.Fun.ArgInfo          = 0;
   I.Fun.hasExceptionSpec = hasExceptionSpec;
+  I.Fun.ThrowLoc         = ThrowLoc.getRawEncoding();
   I.Fun.hasAnyExceptionSpec = hasAnyExceptionSpec;
   I.Fun.NumExceptions    = NumExceptions;
   I.Fun.Exceptions       = 0;
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 4fc713c..39eaf36 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -2274,6 +2274,7 @@
     // cv-qualifier-seq[opt].
     DeclSpec DS;
     bool hasExceptionSpec = false;
+    SourceLocation ThrowLoc;
     bool hasAnyExceptionSpec = false;
     llvm::SmallVector<TypeTy*, 2> Exceptions;
     llvm::SmallVector<SourceRange, 2> ExceptionRanges;
@@ -2285,6 +2286,7 @@
       // Parse exception-specification[opt].
       if (Tok.is(tok::kw_throw)) {
         hasExceptionSpec = true;
+        ThrowLoc = Tok.getLocation();
         ParseExceptionSpecification(Loc, Exceptions, ExceptionRanges,
                                     hasAnyExceptionSpec);
         assert(Exceptions.size() == ExceptionRanges.size() &&
@@ -2299,7 +2301,7 @@
                                                SourceLocation(),
                                                /*arglist*/ 0, 0,
                                                DS.getTypeQualifiers(),
-                                               hasExceptionSpec,
+                                               hasExceptionSpec, ThrowLoc,
                                                hasAnyExceptionSpec,
                                                Exceptions.data(),
                                                ExceptionRanges.data(),
@@ -2448,6 +2450,7 @@
 
   DeclSpec DS;
   bool hasExceptionSpec = false;
+  SourceLocation ThrowLoc;
   bool hasAnyExceptionSpec = false;
   llvm::SmallVector<TypeTy*, 2> Exceptions;
   llvm::SmallVector<SourceRange, 2> ExceptionRanges;
@@ -2460,6 +2463,7 @@
     // Parse exception-specification[opt].
     if (Tok.is(tok::kw_throw)) {
       hasExceptionSpec = true;
+      ThrowLoc = Tok.getLocation();
       ParseExceptionSpecification(Loc, Exceptions, ExceptionRanges,
                                   hasAnyExceptionSpec);
       assert(Exceptions.size() == ExceptionRanges.size() &&
@@ -2472,7 +2476,7 @@
                                              EllipsisLoc,
                                              ParamInfo.data(), ParamInfo.size(),
                                              DS.getTypeQualifiers(),
-                                             hasExceptionSpec,
+                                             hasExceptionSpec, ThrowLoc,
                                              hasAnyExceptionSpec,
                                              Exceptions.data(),
                                              ExceptionRanges.data(),
@@ -2551,7 +2555,8 @@
                                              SourceLocation(),
                                              &ParamInfo[0], ParamInfo.size(),
                                              /*TypeQuals*/0,
-                                             /*exception*/false, false, 0, 0, 0,
+                                             /*exception*/false,
+                                             SourceLocation(), false, 0, 0, 0,
                                              LParenLoc, D),
                 RLoc);
 }
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 8b8d4e1..cd62c64 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -1481,7 +1481,8 @@
     ParamInfo.AddTypeInfo(DeclaratorChunk::getFunction(true, false, 
                                                        SourceLocation(),
                                                        0, 0, 0,
-                                                       false, false, 0, 0, 0,
+                                                       false, SourceLocation(),
+                                                       false, 0, 0, 0,
                                                        CaretLoc, ParamInfo),
                           CaretLoc);