Skip to content

Commit 4b75a19

Browse files
committed
Fix bad rebase
1 parent 52da0fc commit 4b75a19

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

src/ir/ty.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ impl Type {
10271027
TypeKind::Function(signature)
10281028
// Same here, with template specialisations we can safely
10291029
// assume this is a Comp(..)
1030-
} else if ty.is_fully_specialized_template() {
1030+
} else if ty.is_fully_instantiated_template() {
10311031
debug!("Template specialization: {:?}, {:?} {:?}",
10321032
ty,
10331033
location,
@@ -1042,8 +1042,7 @@ impl Type {
10421042
match location.kind() {
10431043
CXCursor_CXXBaseSpecifier |
10441044
CXCursor_ClassTemplate => {
1045-
if location.kind() ==
1046-
CXCursor_CXXBaseSpecifier {
1045+
if location.kind() == CXCursor_CXXBaseSpecifier {
10471046
// In the case we're parsing a base specifier
10481047
// inside an unexposed or invalid type, it means
10491048
// that we're parsing one of two things:
@@ -1083,14 +1082,15 @@ impl Type {
10831082
// [2]: forward-inherit-struct-with-fields.hpp
10841083
// [3]: forward-inherit-struct.hpp
10851084
// [4]: inherit-namespaced.hpp
1086-
if
1087-
location.spelling()
1088-
.chars()
1089-
.all(|c| {
1090-
c.is_alphanumeric() || c == '_'
1091-
}) {
1085+
if location.spelling()
1086+
.chars()
1087+
.all(|c| {
1088+
c.is_alphanumeric() || c == '_'
1089+
}) {
10921090
return Err(ParseError::Recurse);
10931091
}
1092+
} else {
1093+
name = location.spelling();
10941094
}
10951095

10961096
let complex = CompInfo::from_ty(potential_id,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(non_snake_case)]
5+
6+
7+
#[repr(C)]
8+
#[derive(Debug, Copy, Clone)]
9+
pub struct Foo {
10+
pub member: Foo,
11+
}
12+
impl Default for Foo {
13+
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
14+
}

tests/expectations/tests/template-param-usage-7.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ pub struct DoesNotUseU<T, V> {
1313
impl <T, V> Default for DoesNotUseU<T, V> {
1414
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1515
}
16-
pub type Alias = DoesNotUseU<::std::os::raw::c_int, ::std::os::raw::c_char>;
16+
pub type Alias = DoesNotUseU<::std::os::raw::c_int, ::std::os::raw::c_schar>;

0 commit comments

Comments
 (0)