tint: Make tint::ast::HasAttribute() accept multiple template arguments
Change-Id: I42efb3e603ac1d92c77e48784f7a9d010ade3047
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96021
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/tint/ast/attribute.h b/src/tint/ast/attribute.h
index 68c4435..03d80c6 100644
--- a/src/tint/ast/attribute.h
+++ b/src/tint/ast/attribute.h
@@ -43,10 +43,10 @@
/// @param attributes the list of attributes to search
/// @returns true if `attributes` includes a attribute of type `T`
-template <typename T>
+template <typename... Ts>
bool HasAttribute(const AttributeList& attributes) {
for (auto* attr : attributes) {
- if (attr->Is<T>()) {
+ if (attr->IsAnyOf<Ts...>()) {
return true;
}
}