blob: 072dcd2413d09ad0a4b352efae921b0d38c98196 [file] [log] [blame]
Rafael Espindolae57e3d32012-12-27 03:56:20 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3namespace test1 {
4 int x; // expected-note {{previous definition is here}}
5 static int y; // expected-note {{previous definition is here}}
6 void f() {} // expected-note {{previous definition is here}}
7
8 extern "C" {
9 extern int x; // expected-error {{declaration of 'x' has a different language linkage}}
10 extern int y; // expected-error {{declaration of 'y' has a different language linkage}}
11 void f(); // expected-error {{declaration of 'f' has a different language linkage}}
12 }
13}
Rafael Espindola78eeba82012-12-28 14:21:58 +000014
15extern "C" {
16 static void test2_f() { // expected-note {{previous definition is here}}
17 }
18 static void test2_f(int x) { // expected-error {{conflicting types for 'test2_f'}}
19 }
20}
Rafael Espindola6acc4bc2013-01-05 01:28:37 +000021
22namespace test3 {
23 extern "C" {
24 namespace {
25 extern int x2;
26 void f2();
27 }
28 }
29 namespace {
30 int x2;
31 void f2() {}
32 }
33}
34
35namespace test4 {
36 void dummy() {
37 void Bar();
38 class A {
39 friend void Bar();
40 };
41 }
42}
Rafael Espindolaabe75ef2013-01-09 16:34:58 +000043
44namespace test5 {
45 static void g();
46 void f()
47 {
48 void g();
49 }
50}