summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Vukicevic <vladimir@pobox.com>2016-12-13 13:46:00 -0500
committerVladimir Vukicevic <vladimir@pobox.com>2016-12-13 13:46:40 -0500
commit8f0320d1b0c7a1f9ddf93ecf453af0a2266ec552 (patch)
tree5b0436ec0b6eeb033a9644912ee860683dbd0504
parentf02edbe10952f1a3b5350563591afed52b534921 (diff)
Silence the 'Unhandled cursor kind' warning for toplevel operator overloads and using directives
-rw-r--r--libbindgen/src/ir/item.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/libbindgen/src/ir/item.rs b/libbindgen/src/ir/item.rs
index 301085dc..00c29822 100644
--- a/libbindgen/src/ir/item.rs
+++ b/libbindgen/src/ir/item.rs
@@ -950,6 +950,7 @@ impl ClangItemParser for Item {
CXCursor_MacroDefinition |
CXCursor_MacroExpansion |
CXCursor_UsingDeclaration |
+ CXCursor_UsingDirective |
CXCursor_StaticAssert |
CXCursor_InclusionDirective => {
debug!("Unhandled cursor kind {:?}: {:?}",
@@ -957,9 +958,13 @@ impl ClangItemParser for Item {
cursor);
}
_ => {
- error!("Unhandled cursor kind {:?}: {:?}",
- cursor.kind(),
- cursor);
+ // ignore toplevel operator overloads
+ let spelling = cursor.spelling();
+ if !spelling.starts_with("operator") {
+ error!("Unhandled cursor kind {:?}: {:?}",
+ cursor.kind(),
+ cursor);
+ }
}
}