diff options
author | Eli Bendersky <eliben@chromium.org> | 2013-07-15 16:08:08 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@chromium.org> | 2013-07-15 16:08:08 -0700 |
commit | e789858899a7b36caf11b371a97411a1582a482b (patch) | |
tree | e8c28b178b32010f73b477b3c65b5ff74437530c /test/SemaCXX/linkage2.cpp | |
parent | 99a5501f5ae5b75017dfc386d4abf648234e85df (diff) | |
parent | 20c7d45a4da9f58ad805ad1d37f92fe7dc232ec8 (diff) |
Merge commit '20c7d45a4da9f58ad805ad1d37f92fe7dc232ec8'
Conflicts:
lib/CodeGen/ItaniumCXXABI.cpp
Diffstat (limited to 'test/SemaCXX/linkage2.cpp')
-rw-r--r-- | test/SemaCXX/linkage2.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/SemaCXX/linkage2.cpp b/test/SemaCXX/linkage2.cpp index 2cee581b49..3cfa98138b 100644 --- a/test/SemaCXX/linkage2.cpp +++ b/test/SemaCXX/linkage2.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -fmodules %s namespace test1 { int x; // expected-note {{previous definition is here}} @@ -125,3 +126,41 @@ extern "C" { void __attribute__((overloadable)) test11_g(double); } } + +namespace test12 { + const int n = 0; + extern const int n; + void f() { + extern const int n; + } +} + +namespace test13 { + static void a(void); + extern void a(); + static void a(void) {} +} + +namespace test14 { + namespace { + void a(void); // expected-note {{previous declaration is here}} + static void a(void) {} // expected-error {{static declaration of 'a' follows non-static declaration}} + } +} + +namespace test15 { + const int a = 5; // expected-note {{previous definition is here}} + static const int a; // expected-error {{redefinition of 'a'}} +} + +namespace test16 { + extern "C" { + class Foo { + int x; + friend int bar(Foo *y); + }; + int bar(Foo *y) { + return y->x; + } + } +} |