]> granicus.if.org Git - clang/commitdiff
Downgrade errors when trying to catch a pointer or reference to
authorDouglas Gregor <dgregor@apple.com>
Sun, 7 Mar 2010 23:28:27 +0000 (23:28 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 7 Mar 2010 23:28:27 +0000 (23:28 +0000)
incomplete type to warnings; GCC (and EDG in GCC compatibility mode)
permit such handles. Fixes PR6527.

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

test/SemaCXX/exceptions.cpp
test/SemaTemplate/instantiate-function-1.cpp

index 924b48aad26fccab59eaadab7dc660104e37e39b..ab37e3c644664edc333fba5997936d013def7c42 100644 (file)
@@ -12,8 +12,8 @@ void trys() {
   } catch(float i) {
   } catch(void v) { // expected-error {{cannot catch incomplete type 'void'}}
   } catch(A a) { // expected-error {{cannot catch incomplete type 'struct A'}}
-  } catch(A *a) { // expected-error {{cannot catch pointer to incomplete type 'struct A'}}
-  } catch(A &a) { // expected-error {{cannot catch reference to incomplete type 'struct A'}}
+  } catch(A *a) { // expected-warning {{pointer to incomplete type 'struct A'}}
+  } catch(A &a) { // expected-warning {{reference to incomplete type 'struct A'}}
   } catch(Abstract) { // expected-error {{variable type 'Abstract' is an abstract class}}
   } catch(...) {
     int j = i; // expected-error {{use of undeclared identifier 'i'}}
index 144c630fce51c95f4e546525397b7bbbbbf1d894..7b4c53cfe0d7301812ed11a14a1faedda41752dc 100644 (file)
@@ -194,7 +194,7 @@ template struct IndirectGoto0<int>; // expected-note{{instantiation}}
 template<typename T> struct TryCatch0 {
   void f() {
     try {
-    } catch (T t) { // expected-error{{incomplete type}} \
+    } catch (T t) { // expected-warning{{incomplete type}} \
                     // expected-error{{abstract class}}
     } catch (...) {
     }