[clang] b406819 - [clang][Parser][NFC] Reformat if statement
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 28 03:33:01 PDT 2023
Author: Timm Bäder
Date: 2023-09-28T12:32:30+02:00
New Revision: b4068198327951f5298f9255c499a1d6c4cd6493
URL: https://github.com/llvm/llvm-project/commit/b4068198327951f5298f9255c499a1d6c4cd6493
DIFF: https://github.com/llvm/llvm-project/commit/b4068198327951f5298f9255c499a1d6c4cd6493.diff
LOG: [clang][Parser][NFC] Reformat if statement
Pull the nested if statement into the outer one.
Added:
Modified:
clang/lib/Parse/Parser.cpp
Removed:
################################################################################
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 9d2c2fd9a5fa5d6..0f930248e77174b 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -1449,12 +1449,12 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
// With abbreviated function templates - we need to explicitly add depth to
// account for the implicit template parameter list induced by the template.
- if (auto *Template = dyn_cast_or_null<FunctionTemplateDecl>(Res))
- if (Template->isAbbreviated() &&
- Template->getTemplateParameters()->getParam(0)->isImplicit())
- // First template parameter is implicit - meaning no explicit template
- // parameter list was specified.
- CurTemplateDepthTracker.addDepth(1);
+ if (const auto *Template = dyn_cast_if_present<FunctionTemplateDecl>(Res);
+ Template && Template->isAbbreviated() &&
+ Template->getTemplateParameters()->getParam(0)->isImplicit())
+ // First template parameter is implicit - meaning no explicit template
+ // parameter list was specified.
+ CurTemplateDepthTracker.addDepth(1);
if (SkipFunctionBodies && (!Res || Actions.canSkipFunctionBody(Res)) &&
trySkippingFunctionBody()) {
More information about the cfe-commits
mailing list