[clang] 268025e - Fix "unused variable" warning from recent GCC.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 11:33:36 PDT 2020


Author: Richard Smith
Date: 2020-07-15T11:33:25-07:00
New Revision: 268025e2636c023fc39eed80cc4589f7ce9db786

URL: https://github.com/llvm/llvm-project/commit/268025e2636c023fc39eed80cc4589f7ce9db786
DIFF: https://github.com/llvm/llvm-project/commit/268025e2636c023fc39eed80cc4589f7ce9db786.diff

LOG: Fix "unused variable" warning from recent GCC.

Added: 
    

Modified: 
    clang/lib/AST/ExprConstant.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index d20c2382b6ac..41a4ae4b91c8 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -9930,8 +9930,7 @@ namespace {
       const ConstantArrayType *CAT =
           Info.Ctx.getAsConstantArrayType(E->getType());
       if (!CAT) {
-        if (const IncompleteArrayType *IAT =
-                Info.Ctx.getAsIncompleteArrayType(E->getType())) {
+        if (E->getType()->isIncompleteArrayType()) {
           // We can be asked to zero-initialize a flexible array member; this
           // is represented as an ImplicitValueInitExpr of incomplete array
           // type. In this case, the array has zero elements.


        


More information about the cfe-commits mailing list