diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-06-28 22:03:51 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-06-28 22:03:51 +0000 |
| commit | 902befa2773dfb3411118d0325e5ace00460c1d2 (patch) | |
| tree | 134cc5d6a3db60545b950f3edc645a45a4a61ec5 /clang/test/SemaCXX/linkage2.cpp | |
| parent | 4d18c9cc4e7f30a74703676c02e3399ebb2cb49f (diff) | |
| download | bcm5719-llvm-902befa2773dfb3411118d0325e5ace00460c1d2.tar.gz bcm5719-llvm-902befa2773dfb3411118d0325e5ace00460c1d2.zip | |
PR7927, PR16247: Reimplement handling of matching extern "C" declarations
across scopes.
When we declare an extern "C" name that is not a redeclaration of an entity in
the same scope, check whether it redeclares some extern "C" entity from another
scope, and if not, check whether it conflicts with a (non-extern-"C") entity in
the translation unit.
When we declare a name in the translation unit that is not a redeclaration,
check whether it conflicts with any extern "C" entities (possibly from other
scopes).
llvm-svn: 185229
Diffstat (limited to 'clang/test/SemaCXX/linkage2.cpp')
| -rw-r--r-- | clang/test/SemaCXX/linkage2.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/linkage2.cpp b/clang/test/SemaCXX/linkage2.cpp index a811575c612..c97a2f4ba74 100644 --- a/clang/test/SemaCXX/linkage2.cpp +++ b/clang/test/SemaCXX/linkage2.cpp @@ -201,3 +201,15 @@ namespace test18 { } void *h() { return f(); } } + +extern "C" void pr16247_foo(int); // expected-note {{here}} +static void pr16247_foo(double); // expected-error {{conflicts with declaration with C language linkage}} +void pr16247_foo(int) {} +void pr16247_foo(double) {} + +namespace PR16247 { + extern "C" void pr16247_bar(int); + static void pr16247_bar(double); + void pr16247_bar(int) {} + void pr16247_bar(double) {} +} |

