diff --git a/bindgen/ir/ty.rs b/bindgen/ir/ty.rs index 19974ade56..32c831146a 100644 --- a/bindgen/ir/ty.rs +++ b/bindgen/ir/ty.rs @@ -1193,7 +1193,7 @@ impl Type { } }; - name = name.filter(|n| !n.is_empty()); + name = name.filter(|n| !n.is_empty() && clang::is_valid_identifier(n)); let is_const = ty.is_const() || (ty.kind() == CXType_ConstantArray &&