mirror of
https://gitee.com/openharmony/third_party_rust_bindgen
synced 2024-12-13 18:27:14 +00:00
Refine test for C++ operators
This commit is contained in:
parent
a2fa62422f
commit
d4c3d4c5ff
@ -377,9 +377,14 @@ impl FunctionSig {
|
||||
return Err(ParseError::Continue);
|
||||
}
|
||||
|
||||
// Don't parse operatorxx functions in C++
|
||||
let spelling = cursor.spelling();
|
||||
if spelling.starts_with("operator") {
|
||||
|
||||
// Don't parse operatorxx functions in C++
|
||||
let is_operator = |spelling: &str| {
|
||||
spelling.starts_with("operator") &&
|
||||
!clang::is_valid_identifier(spelling)
|
||||
};
|
||||
if is_operator(&spelling) {
|
||||
return Err(ParseError::Continue);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user