[clang] 3a158cc - [clang] Fix -Wreorder-ctor of DependentFunctionTemplateSpecializationInfo (NFC)
Jie Fu via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 7 00:34:50 PDT 2023
Author: Jie Fu
Date: 2023-10-07T15:33:22+08:00
New Revision: 3a158cc875a383e2d5b8da487633e53d061942f1
URL: https://github.com/llvm/llvm-project/commit/3a158cc875a383e2d5b8da487633e53d061942f1
DIFF: https://github.com/llvm/llvm-project/commit/3a158cc875a383e2d5b8da487633e53d061942f1.diff
LOG: [clang] Fix -Wreorder-ctor of DependentFunctionTemplateSpecializationInfo (NFC)
/llvm-project/clang/lib/AST/Decl.cpp:4182:7: error: field 'TemplateArgumentsAsWritten' will be initialized after field 'NumCandidates' [-Werror,-Wreorder-ctor]
: TemplateArgumentsAsWritten(TemplateArgsWritten),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NumCandidates(Candidates.size())
1 error generated.
Added:
Modified:
clang/lib/AST/Decl.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index f4a73f137fcf87a..480639606d22525 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -4179,8 +4179,8 @@ DependentFunctionTemplateSpecializationInfo::
DependentFunctionTemplateSpecializationInfo(
const UnresolvedSetImpl &Candidates,
const ASTTemplateArgumentListInfo *TemplateArgsWritten)
- : TemplateArgumentsAsWritten(TemplateArgsWritten),
- NumCandidates(Candidates.size()) {
+ : NumCandidates(Candidates.size()),
+ TemplateArgumentsAsWritten(TemplateArgsWritten) {
std::transform(Candidates.begin(), Candidates.end(),
getTrailingObjects<FunctionTemplateDecl *>(),
[](NamedDecl *ND) {
More information about the cfe-commits
mailing list