forked from OSchip/llvm-project
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. llvm-svn: 97925
This commit is contained in:
parent
281c486e1b
commit
254bba4095
|
@ -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'}}
|
||||
|
|
|
@ -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 (...) {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue