diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-12-27 03:56:20 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-12-27 03:56:20 +0000 |
| commit | cffa95d73f784da33858930dbfd019361b4ded41 (patch) | |
| tree | 403596602cbe70f89a360ab36c0445ae2ec9d64a /clang/test/SemaCXX/linkage2.cpp | |
| parent | 396cb795bc5725645d440ca81fd711ad40ba7403 (diff) | |
| download | bcm5719-llvm-cffa95d73f784da33858930dbfd019361b4ded41.tar.gz bcm5719-llvm-cffa95d73f784da33858930dbfd019361b4ded41.zip | |
Implement dcl.link paragraph 5.
The language linkage of redeclarations must match. GCC was already reporting
an error for this.
llvm-svn: 171139
Diffstat (limited to 'clang/test/SemaCXX/linkage2.cpp')
| -rw-r--r-- | clang/test/SemaCXX/linkage2.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/linkage2.cpp b/clang/test/SemaCXX/linkage2.cpp new file mode 100644 index 00000000000..ccf32008f13 --- /dev/null +++ b/clang/test/SemaCXX/linkage2.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +namespace test1 { + int x; // expected-note {{previous definition is here}} + static int y; // expected-note {{previous definition is here}} + void f() {} // expected-note {{previous definition is here}} + + extern "C" { + extern int x; // expected-error {{declaration of 'x' has a different language linkage}} + extern int y; // expected-error {{declaration of 'y' has a different language linkage}} + void f(); // expected-error {{declaration of 'f' has a different language linkage}} + } +} |

