]> granicus.if.org Git - clang/commitdiff
Fix compilation warning about unused variable [NFC]
authorMikael Holmen <mikael.holmen@ericsson.com>
Mon, 20 May 2019 11:38:33 +0000 (11:38 +0000)
committerMikael Holmen <mikael.holmen@ericsson.com>
Mon, 20 May 2019 11:38:33 +0000 (11:38 +0000)
Without the fix at least clang 3.6 complains with

../tools/clang/lib/AST/ExprConstant.cpp:90:24: error: unused variable 'TI' [-Werror,-Wunused-variable]
    if (TypeInfoLValue TI = B.dyn_cast<TypeInfoLValue>())
                       ^
1 error generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361145 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp

index 856efc82941eb4a10ef87a982f8b79cbc3025f9d..e654480f09419a4010a7cc236b6dcd84d0c45d66 100644 (file)
@@ -87,7 +87,7 @@ namespace {
       return D->getType();
     }
 
-    if (TypeInfoLValue TI = B.dyn_cast<TypeInfoLValue>())
+    if (B.is<TypeInfoLValue>())
       return B.getTypeInfoType();
 
     const Expr *Base = B.get<const Expr*>();