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/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 833620b..81ac211 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -737,7 +737,7 @@
       // does not have a K&R-style identifier list), then the arguments are part
       // of the type, otherwise the argument list is ().
       const DeclaratorChunk::FunctionTypeInfo &FTI = DeclType.Fun;
-      
+
       // C99 6.7.5.3p1: The return type may not be a function or array type.
       if (T->isArrayType() || T->isFunctionType()) {
         Diag(DeclType.Loc, diag::err_func_returning_array_function) << T;
@@ -754,6 +754,12 @@
             << Context.getTypeDeclType(Tag);
       }
 
+      // Exception specs are not allowed in typedefs. Complain, but add it
+      // anyway.
+      if (FTI.hasExceptionSpec &&
+          D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef)
+        Diag(FTI.getThrowLoc(), diag::err_exception_spec_in_typedef);
+
       if (FTI.NumArgs == 0) {
         if (getLangOptions().CPlusPlus) {
           // C++ 8.3.5p2: If the parameter-declaration-clause is empty, the
@@ -978,17 +984,13 @@
   // C++ 15.4p2: A type denoted in an exception-specification shall not denote
   //   an incomplete type a pointer or reference to an incomplete type, other
   //   than (cv) void*.
-  // The standard does not mention member pointers, but it has to mean them too.
   int kind;
   if (const PointerType* IT = T->getAsPointerType()) {
     T = IT->getPointeeType();
     kind = 1;
-  } else if (const MemberPointerType* IT = T->getAsMemberPointerType()) {
-    T = IT->getPointeeType();
-    kind = 2;
   } else if (const ReferenceType* IT = T->getAsReferenceType()) {
     T = IT->getPointeeType();
-    kind = 3;
+    kind = 2;
   } else
     return false;