Skip to content

Commit 21861ea

Browse files
authored
Merge pull request rust-lang#1218 from emilio/clang-trunk
Clang trunk considers stuff in an anonymous namespace with internal linkage.
2 parents 37c6e53 + 65a4ca0 commit 21861ea

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

tests/expectations/tests/namespace.rs

-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

3-
43
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
54

6-
75
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
86
pub mod root {
97
#[allow(unused_imports)]
@@ -24,10 +22,6 @@ pub mod root {
2422
pub mod _bindgen_mod_id_13 {
2523
#[allow(unused_imports)]
2624
use self::super::super::root;
27-
extern "C" {
28-
#[link_name = "\u{1}_ZN12_GLOBAL__N_13fooEv"]
29-
pub fn foo();
30-
}
3125
#[repr(C)]
3226
#[derive(Debug, Default, Copy, Clone)]
3327
pub struct A {
@@ -51,18 +45,6 @@ pub mod root {
5145
concat!("Offset of field: ", stringify!(A), "::", stringify!(b))
5246
);
5347
}
54-
extern "C" {
55-
#[link_name = "\u{1}_ZN12_GLOBAL__N_11A20lets_hope_this_worksEv"]
56-
pub fn A_lets_hope_this_works(
57-
this: *mut root::_bindgen_mod_id_13::A,
58-
) -> ::std::os::raw::c_int;
59-
}
60-
impl A {
61-
#[inline]
62-
pub unsafe fn lets_hope_this_works(&mut self) -> ::std::os::raw::c_int {
63-
A_lets_hope_this_works(self)
64-
}
65-
}
6648
}
6749
#[repr(C)]
6850
#[derive(Debug)]

tests/headers/namespace.hpp

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ namespace whatever {
1111
namespace {
1212
namespace empty {}
1313

14-
void foo();
1514
struct A {
1615
whatever::whatever_int_t b;
17-
public:
18-
int lets_hope_this_works();
1916
};
2017
}
2118

@@ -26,11 +23,9 @@ class C: public A {
2623
T m_c_arr[10];
2724
};
2825

29-
3026
template<>
3127
class C<int>;
3228

33-
3429
namespace w {
3530
typedef unsigned int whatever_int_t;
3631

0 commit comments

Comments
 (0)