Validator: Fix GCC unused variable warning / error

Change-Id: I36e1a86328249abccfde4e6b7712d6e2a9d32c7b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/45286
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/validator/validator_impl.cc b/src/validator/validator_impl.cc
index d57a3c4..eaf131a 100644
--- a/src/validator/validator_impl.cc
+++ b/src/validator/validator_impl.cc
@@ -71,7 +71,7 @@
 
   // Validate global declarations in the order they appear in the module.
   for (auto* decl : program_->AST().GlobalDeclarations()) {
-    if (auto* ty = decl->As<type::Type>()) {
+    if (decl->Is<type::Type>()) {
       // Validated by Resolver (Struct types only)
       return true;
     } else if (auto* func = decl->As<ast::Function>()) {