From 3acbe8145c60f4d1e7a180b4602a94269a489df5 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 27 Apr 2023 12:36:59 +0800 Subject: Fix most of the disabled warnings on gcc/clang (#2839) --- source/slang/slang-check-modifier.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/slang-check-modifier.cpp') diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index e9c78e155..78a9fd163 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -500,7 +500,7 @@ namespace Slang return false; } } - else if (auto unrollAttr = as(attr)) + else if (const auto unrollAttr = as(attr)) { // Check has an argument. We need this because default behavior is to give an error // if an attribute has arguments, but not handled explicitly (and the default param will come through @@ -532,7 +532,7 @@ namespace Slang } } } - else if (auto userDefAttr = as(attr)) + else if (const auto userDefAttr = as(attr)) { // check arguments against attribute parameters defined in attribClassDecl Index paramIndex = 0; @@ -704,7 +704,7 @@ namespace Slang return false; } } - else if (auto derivativeMemberAttr = as(attr)) + else if (const auto derivativeMemberAttr = as(attr)) { auto varDecl = as(attrTarget); if (!varDecl) @@ -801,7 +801,7 @@ namespace Slang { // We didn't have enough arguments for the // number of parameters declared. - if(auto defaultArg = paramDecl->initExpr) + if(const auto defaultArg = paramDecl->initExpr) { // The attribute declaration provided a default, // so we should use that. @@ -884,7 +884,7 @@ namespace Slang } } - if (auto externModifier = as(m)) + if (const auto externModifier = as(m)) { if (auto varDecl = as(syntaxNode)) { -- cgit v1.2.3