Files
clang-p2996/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
Aaron Ballman 9ef622e5bf The exception-declaration for a function-try-block cannot redeclare a
function parameter. One of our existing test cases was XFAILed because
of this. This fixes the issue and un-XFAILs the test.

llvm-svn: 210026
2014-06-02 13:10:07 +00:00

22 lines
493 B
C++

// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
class C {
public:
C(int a, int b);
};
C::C(int a, // expected-note {{previous definition}}
int b) // expected-note {{previous definition}}
try {
int c;
} catch (int a) { // expected-error {{redefinition of 'a'}}
int b; // expected-error {{redefinition of 'b'}}
++c; // expected-error {{use of undeclared identifier 'c'}}
}
void f(int i) {
struct S {
void g() try {} catch (int i) {}; // OK
};
}