summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Kulp <darren@kulp.ch>2020-06-29 05:45:53 -0700
committerEmilio Cobos Álvarez <emilio@crisal.io>2020-07-01 13:30:52 +0200
commitd4c3d4c5ffab9a9a65545bc1bb8ab06c771d5c81 (patch)
tree7122b01c6111564e543a786764b19761b2f0ae11
parenta2fa62422fc2c94b5732dc2ed4326c6f3fbbc622 (diff)
Refine test for C++ operators
-rw-r--r--src/ir/function.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs
index e811a721..93a8d89f 100644
--- a/src/ir/function.rs
+++ b/src/ir/function.rs
@@ -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);
}