]> granicus.if.org Git - clang/commitdiff
Remove a recovery attempt that was untested and crashed when used.
authorNico Weber <nicolasweber@gmx.de>
Tue, 17 Feb 2015 20:09:39 +0000 (20:09 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 17 Feb 2015 20:09:39 +0000 (20:09 +0000)
Found by SLi's bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229532 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaType.cpp
test/SemaCXX/member-pointer.cpp

index 8e86c73ccbeba51ae25e1fcfc1fe9a48801022d0..56142253a0886ac0477ea3aba4bc6b4006cc3f82 100644 (file)
@@ -1810,13 +1810,7 @@ QualType Sema::BuildMemberPointerType(QualType T, QualType Class,
   // exception specification.
   if (CheckDistantExceptionSpec(T)) {
     Diag(Loc, diag::err_distant_exception_spec);
-
-    // FIXME: If we're doing this as part of template instantiation,
-    // we should return immediately.
-
-    // Build the type anyway, but use the canonical type so that the
-    // exception specifiers are stripped off.
-    T = Context.getCanonicalType(T);
+    return QualType();
   }
 
   // C++ 8.3.3p3: A pointer to member shall not point to ... a member
index b9e5a631baa2d860dbbeecfe13e18be55d979eb4..afb7455921e7ac43fd7541920ede38f52ca94410 100644 (file)
@@ -12,6 +12,7 @@ class H : A {}; // expected-note 2{{implicitly declared private here}}
 int A::*pdi1;
 int (::A::*pdi2);
 int (A::*pfi)(int);
+void (*A::*ppfie)() throw(); // expected-error {{exception specifications are not allowed beyond a single level of indirection}}
 
 int B::*pbi; // expected-warning{{use of enumeration in a nested name specifier is a C++11 extension}} \
              // expected-error {{'pbi' does not point into a class}}