diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-06-02 13:10:07 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-06-02 13:10:07 +0000 |
| commit | 9ef622e5bf6467a4d5295fad1486956c4dcac22d (patch) | |
| tree | 82b25e7fbc6f03431ca7c8746b5bc0fe413cd26c /clang/test | |
| parent | 1d1c4fb81cd64d6dadb05a1bd15e1152348c7a75 (diff) | |
| download | bcm5719-llvm-9ef622e5bf6467a4d5295fad1486956c4dcac22d.tar.gz bcm5719-llvm-9ef622e5bf6467a4d5295fad1486956c4dcac22d.zip | |
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
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp | 8 | ||||
| -rw-r--r-- | clang/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp b/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp index 7df0f536cf0..c59c4a550d7 100644 --- a/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp +++ b/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s -// XFAIL: * class C { public: @@ -10,8 +9,13 @@ 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 + }; +} diff --git a/clang/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp b/clang/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp index 7c7b84d6782..1b4199155fa 100644 --- a/clang/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp +++ b/clang/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp @@ -9,8 +9,8 @@ void func2(int i) try { // expected-note{{previous definition is here}} } catch (...) { } -void func3(int i) try { // FIXME: note {{previous definition is here}} -} catch (int i) { // FIXME: error {{redefinition of 'i'}} +void func3(int i) try { // expected-note {{previous definition is here}} +} catch (int i) { // expected-error {{redefinition of 'i'}} } void func4(int i) try { // expected-note{{previous definition is here}} @@ -58,3 +58,9 @@ void func10() { int b; // FIXME: decide whether this is valid } } + +void func11(int a) { + try { + } catch (int a) { // OK + } +} |

