diff options
author | ed <ed@FreeBSD.org> | 2009-07-04 13:58:54 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-07-04 13:58:54 +0000 |
commit | 4981926bf654fe5a2c3893f24ca44106b217e71e (patch) | |
tree | 8ddfe382e1c6d590dc240e76f7cd45cea5c78e24 /test/SemaCXX/exception-spec.cpp | |
parent | c1ff020ff2d3e7ba86f7ab986ac7569c34f2ab1a (diff) | |
download | FreeBSD-src-4981926bf654fe5a2c3893f24ca44106b217e71e.zip FreeBSD-src-4981926bf654fe5a2c3893f24ca44106b217e71e.tar.gz |
Import Clang r74788.
Diffstat (limited to 'test/SemaCXX/exception-spec.cpp')
-rw-r--r-- | test/SemaCXX/exception-spec.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/test/SemaCXX/exception-spec.cpp b/test/SemaCXX/exception-spec.cpp index ea02aac..5eba26e 100644 --- a/test/SemaCXX/exception-spec.cpp +++ b/test/SemaCXX/exception-spec.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: clang-cc -fsyntax-only -verify -fms-extensions %s // Straight from the standard: // Plain function with spec @@ -33,3 +33,31 @@ void ic2() throw(Incomplete); // expected-error {{incomplete type 'struct Incomp void ic3() throw(void*); void ic4() throw(Incomplete*); // expected-error {{pointer to incomplete type 'struct Incomplete' is not allowed in exception specification}} void ic5() throw(Incomplete&); // expected-error {{reference to incomplete type 'struct Incomplete' is not allowed in exception specification}} + +// Redeclarations +typedef int INT; +void r1() throw(int); +void r1() throw(int); + +void r2() throw(int); +void r2() throw(INT); + +// throw-any spec and no spec at all are semantically equivalent +void r3(); +void r3() throw(...); + +void r4() throw(int, float); +void r4() throw(float, int); + +void r5() throw(int); // expected-note {{previous declaration}} +void r5(); // expected-error {{exception specification in declaration does not match}} + +void r6() throw(...); // expected-note {{previous declaration}} +void r6() throw(int); // expected-error {{exception specification in declaration does not match}} + +void r7() throw(int); // expected-note {{previous declaration}} +void r7() throw(float); // expected-error {{exception specification in declaration does not match}} + +// Top-level const doesn't matter. +void r8() throw(int); +void r8() throw(const int); |