[cfe-commits] r97925 - in /cfe/trunk/test: SemaCXX/exceptions.cpp SemaTemplate/instantiate-function-1.cpp

Douglas Gregor dgregor at apple.com
Sun Mar 7 15:28:27 PST 2010


Author: dgregor
Date: Sun Mar  7 17:28:27 2010
New Revision: 97925

URL: http://llvm.org/viewvc/llvm-project?rev=97925&view=rev
Log:
Downgrade errors when trying to catch a pointer or reference to
incomplete type to warnings; GCC (and EDG in GCC compatibility mode)
permit such handles. Fixes PR6527.

Modified:
    cfe/trunk/test/SemaCXX/exceptions.cpp
    cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp

Modified: cfe/trunk/test/SemaCXX/exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/exceptions.cpp?rev=97925&r1=97924&r2=97925&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/exceptions.cpp (original)
+++ cfe/trunk/test/SemaCXX/exceptions.cpp Sun Mar  7 17:28:27 2010
@@ -12,8 +12,8 @@
   } 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'}}

Modified: cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp?rev=97925&r1=97924&r2=97925&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp Sun Mar  7 17:28:27 2010
@@ -194,7 +194,7 @@
 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 (...) {
     }





More information about the cfe-commits mailing list