Author: Simon Pilgrim
Date: 2021-10-14T12:51:34+01:00
New Revision: b577126d626855fabc11a203e7a7e0187d48c227

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

LOG: [clang][sema] instantiateOMPDeclareVariantAttr - merge repeated 
VariantFuncRef.get() calls. NFCI.

Fixes scan-build warning about dead initialization

Added: 
    

Modified: 
    clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp 
b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 70c42a19978c..5ddac3c98c25 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -436,11 +436,11 @@ static void instantiateOMPDeclareVariantAttr(
     return;
 
   Expr *E = VariantFuncRef.get();
+
   // Check function/variant ref for `omp declare variant` but not for `omp
   // begin declare variant` (which use implicit attributes).
   Optional<std::pair<FunctionDecl *, Expr *>> DeclVarData =
-      S.checkOpenMPDeclareVariantFunction(S.ConvertDeclToDeclGroup(New),
-                                          VariantFuncRef.get(), TI,
+      S.checkOpenMPDeclareVariantFunction(S.ConvertDeclToDeclGroup(New), E, TI,
                                           Attr.getRange());
 
   if (!DeclVarData)


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to