dawn: Fix GCC build
It's not valid for an explicit template specialization to declare a storage class (`static`). GCC correctly catches this, while Clang is too relaxed.
Use C++17's 'inline' instead. The alternative is to push the initializers and values into the cpp file.
This breakage was introduced in: https://dawn-review.googlesource.com/c/dawn/+/93604
Bug: dawn:1451
Change-Id: Ib3e61d233e16fd7828f8a2ae0909eedbd24ee52e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/generator/templates/dawn/wire/client/ApiObjects.h b/generator/templates/dawn/wire/client/ApiObjects.h
index 719f893..da199cf 100644
--- a/generator/templates/dawn/wire/client/ApiObjects.h
+++ b/generator/templates/dawn/wire/client/ApiObjects.h
@@ -21,7 +21,7 @@
namespace dawn::wire::client {
template<typename T>
- static constexpr ObjectType ObjectTypeToTypeEnum = static_cast<ObjectType>(-1);
+ inline constexpr ObjectType ObjectTypeToTypeEnum = static_cast<ObjectType>(-1);
{% for type in by_category["object"] %}
{% set Type = type.name.CamelCase() %}
@@ -41,7 +41,7 @@
}
template <>
- static constexpr ObjectType ObjectTypeToTypeEnum<{{Type}}> = ObjectType::{{Type}};
+ inline constexpr ObjectType ObjectTypeToTypeEnum<{{Type}}> = ObjectType::{{Type}};
{% endfor %}
} // namespace dawn::wire::client