https://github.com/bricknerb created https://github.com/llvm/llvm-project/pull/116226
None >From 35c1a01df73a52acda55bb4a162fdbddd03c764d Mon Sep 17 00:00:00 2001 From: Boaz Brickner <brick...@google.com> Date: Thu, 14 Nov 2024 14:27:33 +0100 Subject: [PATCH] [clang] [NFC] Merge two ifs to a single one --- clang/lib/Sema/SemaCUDA.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/SemaCUDA.cpp b/clang/lib/Sema/SemaCUDA.cpp index ec37c0df56c671..6fe10e41e3d9f2 100644 --- a/clang/lib/Sema/SemaCUDA.cpp +++ b/clang/lib/Sema/SemaCUDA.cpp @@ -659,9 +659,9 @@ void SemaCUDA::checkAllowedInitializer(VarDecl *VD) { // Return early if VD is inside a non-instantiated template function since // the implicit constructor is not defined yet. if (const FunctionDecl *FD = - dyn_cast_or_null<FunctionDecl>(VD->getDeclContext())) - if (FD->isDependentContext()) - return; + dyn_cast_or_null<FunctionDecl>(VD->getDeclContext()); + FD && FD->isDependentContext()) + return; // Do not check dependent variables since the ctor/dtor/initializer are not // determined. Do it after instantiation. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits