Return UnsupportedItem when `volatile` qualifier is used.
This CL is only loosely related to b/217419782 - I've just noticed that
`volatile` is ignored when working on Importer::ConvertType changes to
support function pointer types.
PiperOrigin-RevId: 428770476
diff --git a/rs_bindings_from_cc/importer.cc b/rs_bindings_from_cc/importer.cc
index d395d98..7ba5a84 100644
--- a/rs_bindings_from_cc/importer.cc
+++ b/rs_bindings_from_cc/importer.cc
@@ -898,10 +898,12 @@
return error;
}
- // Add cv-qualification.
+ // Handle cv-qualification.
type->cc_type.is_const = qual_type.isConstQualified();
- // Not doing volatile for now -- note that volatile pointers do not exist in
- // Rust, though volatile reads/writes still do.
+ if (qual_type.isVolatileQualified()) {
+ return absl::UnimplementedError(
+ absl::StrCat("Unsupported `volatile` qualifier: ", type_string));
+ }
return *std::move(type);
}