summaryrefslogtreecommitdiff
path: root/libbindgen/src/clang.rs
diff options
context:
space:
mode:
Diffstat (limited to 'libbindgen/src/clang.rs')
-rw-r--r--libbindgen/src/clang.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/libbindgen/src/clang.rs b/libbindgen/src/clang.rs
index 72069644..7c6d3199 100644
--- a/libbindgen/src/clang.rs
+++ b/libbindgen/src/clang.rs
@@ -760,6 +760,19 @@ impl Type {
pub fn is_valid_and_exposed(&self) -> bool {
self.is_valid() && self.kind() != CXType_Unexposed
}
+
+ /// Is this type a fully specialized template?
+ pub fn is_fully_specialized_template(&self) -> bool {
+ // Yep, the spelling of this containing type-parameter is extremely
+ // nasty... But can happen in <type_traits>. Unfortunately I couldn't
+ // reduce it enough :(
+ !self.spelling().contains("type-parameter") &&
+ self.template_args()
+ .map_or(false, |mut args| {
+ args.len() > 0 &&
+ !args.any(|t| t.spelling().contains("type-parameter"))
+ })
+ }
}
/// An iterator for a type's template arguments.