Skip to content

Commit 0feedfd

Browse files
Merge from 'main' to 'sycl-web' (127 commits)
CONFLICT (content): Merge conflict in llvm/docs/NVPTXUsage.rst
2 parents 9c4aab8 + 35a509d commit 0feedfd

File tree

960 files changed

+42467
-32128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

960 files changed

+42467
-32128
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ e2c2ffbe7a1b5d9e32a2ce64279475b50c4cba5b
8888
# [lldb][nfc] Deindent ProcessGDBRemote::SetThreadStopInfo by two levels
8989
b32931c5b32eb0d2cf37d688b34f8548c9674c19
9090

91-
# [libc++][NFC] Fix inconsistent quoting and spacing in our CSV files
91+
# [libc++] Various consistency fixes to the CSV files that we use for tracking Standards Conformance
9292
64946fdaf9864d8279da1c30e4d7214fe13d1427
93+
b6262880b34629e9d7a72b5a42f315a3c9ed8139
94+
39c7dc7207e76e72da21cf4fedda21b5311bf62d

clang/bindings/python/clang/cindex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2654,7 +2654,7 @@ def get_exception_specification_kind(self):
26542654
the ExceptionSpecificationKind enumeration.
26552655
"""
26562656
return ExceptionSpecificationKind.from_id(
2657-
conf.lib.clang.getExceptionSpecificationType(self)
2657+
conf.lib.clang_getExceptionSpecificationType(self)
26582658
)
26592659

26602660
@property

clang/bindings/python/tests/cindex/test_exception_specification_kind.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
def find_function_declarations(node, declarations=[]):
1515
if node.kind == clang.cindex.CursorKind.FUNCTION_DECL:
16-
declarations.append((node.spelling, node.exception_specification_kind))
16+
declarations.append(node)
1717
for child in node.get_children():
1818
declarations = find_function_declarations(child, declarations)
1919
return declarations
@@ -33,4 +33,12 @@ def test_exception_specification_kind(self):
3333
("square2", ExceptionSpecificationKind.BASIC_NOEXCEPT),
3434
("square3", ExceptionSpecificationKind.COMPUTED_NOEXCEPT),
3535
]
36-
self.assertListEqual(declarations, expected)
36+
from_cursor = [
37+
(node.spelling, node.exception_specification_kind) for node in declarations
38+
]
39+
from_type = [
40+
(node.spelling, node.type.get_exception_specification_kind())
41+
for node in declarations
42+
]
43+
self.assertListEqual(from_cursor, expected)
44+
self.assertListEqual(from_type, expected)

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,15 @@ if(FUCHSIA_SDK)
300300
set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
301301
endif()
302302

303-
foreach(target armv6m-unknown-eabi;armv7m-unknown-eabi;armv8m.main-unknown-eabi)
303+
foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
304304
list(APPEND BUILTIN_TARGETS "${target}")
305305
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
306306
set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
307307
set(BUILTINS_${target}_CMAKE_SYSROOT "" CACHE STRING "")
308308
set(BUILTINS_${target}_CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "")
309309
foreach(lang C;CXX;ASM)
310310
set(BUILTINS_${target}_CMAKE_${lang}_local_flags "--target=${target} -mthumb")
311-
if(${target} STREQUAL "armv8m.main-unknown-eabi")
311+
if(${target} STREQUAL "armv8m.main-none-eabi")
312312
set(BUILTINS_${target}_CMAKE_${lang}_local_flags "${BUILTINS_${target}_CMAKE_${lang}_local_flags} -mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "")
313313
endif()
314314
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "${BUILTINS_${target}_CMAKE_${lang}_local_flags}" CACHE STRING "")

clang/docs/CommandGuide/clang.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,12 @@ Code Generation Options
429429

430430
:option:`-Ofast` Enables all the optimizations from :option:`-O3` along
431431
with other aggressive optimizations that may violate strict compliance with
432-
language standards. This is deprecated in favor of :option:`-O3`
433-
in combination with :option:`-ffast-math`.
432+
language standards. This is deprecated in Clang 19 and a warning is emitted
433+
that :option:`-O3` in combination with :option:`-ffast-math` should be used
434+
instead if the request for non-standard math behavior is intended. There
435+
is no timeline yet for removal; the aim is to discourage use of
436+
:option:`-Ofast` due to the surprising behavior of an optimization flag
437+
changing the observable behavior of correct code.
434438

435439
:option:`-Os` Like :option:`-O2` with extra optimizations to reduce code
436440
size.

clang/docs/OpenMPSupport.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,5 +358,8 @@ considered for standardization. Please post on the
358358
| device extension | `'ompx_hold' map type modifier | :good:`prototyped` | D106509, D106510 |
359359
| | <https://openmp.llvm.org/docs/openacc/OpenMPExtensions.html#ompx-hold>`_ | | |
360360
+------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
361+
| device extension | `'ompx_bare' clause on 'target teams' construct | :good:`prototyped` | #66844, #70612 |
362+
| | <https://www.osti.gov/servlets/purl/2205717>`_ | | |
363+
+------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
361364

362365
.. _Discourse forums (Runtimes - OpenMP category): https://discourse.llvm.org/c/runtimes/openmp/35

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Bug Fixes in This Version
156156

157157
- Fixed the definition of ``ATOMIC_FLAG_INIT`` in ``<stdatomic.h>`` so it can
158158
be used in C++.
159+
- Fixed a failed assertion when checking required literal types in C context. (#GH101304).
159160

160161
Bug Fixes to Compiler Builtins
161162
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -301,6 +302,7 @@ Sanitizers
301302

302303
Python Binding Changes
303304
----------------------
305+
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.
304306

305307
OpenMP Support
306308
--------------

clang/include/clang/Basic/Builtins.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4654,13 +4654,13 @@ def GetDeviceSideMangledName : LangBuiltin<"CUDA_LANG"> {
46544654

46554655
// HLSL
46564656
def HLSLAll : LangBuiltin<"HLSL_LANG"> {
4657-
let Spellings = ["__builtin_hlsl_elementwise_all"];
4657+
let Spellings = ["__builtin_hlsl_all"];
46584658
let Attributes = [NoThrow, Const];
46594659
let Prototype = "bool(...)";
46604660
}
46614661

46624662
def HLSLAny : LangBuiltin<"HLSL_LANG"> {
4663-
let Spellings = ["__builtin_hlsl_elementwise_any"];
4663+
let Spellings = ["__builtin_hlsl_any"];
46644664
let Attributes = [NoThrow, Const];
46654665
let Prototype = "bool(...)";
46664666
}

clang/include/clang/Basic/riscv_vector.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,9 +2011,9 @@ let ManualCodegen = [{
20112011
RVVConvBuiltinSet<"vfncvt_xu_f_w", "csi", [["Uv", "UvFwu"]]>;
20122012
let OverloadedName = "vfncvt_f" in {
20132013
defm :
2014-
RVVConvBuiltinSet<"vfncvt_f_x_w", "csi", [["Fv", "Fvwu"]]>;
2014+
RVVConvBuiltinSet<"vfncvt_f_x_w", "si", [["Fv", "Fvwu"]]>;
20152015
defm :
2016-
RVVConvBuiltinSet<"vfncvt_f_xu_w", "csi", [["Fv", "FvUwu"]]>;
2016+
RVVConvBuiltinSet<"vfncvt_f_xu_w", "si", [["Fv", "FvUwu"]]>;
20172017
}
20182018
let OverloadedName = "vfncvt_f" in {
20192019
defm : RVVConvBuiltinSet<"vfncvt_f_f_w", "f", [["v", "vwu"]]>;
@@ -2061,9 +2061,9 @@ let ManualCodegen = [{
20612061
RVVConvBuiltinSet<"vfncvt_xu_f_w", "csi", [["Uv", "UvFw"]]>;
20622062
let OverloadedName = "vfncvt_f" in {
20632063
defm :
2064-
RVVConvBuiltinSet<"vfncvt_f_x_w", "csi", [["Fv", "Fvw"]]>;
2064+
RVVConvBuiltinSet<"vfncvt_f_x_w", "si", [["Fv", "Fvw"]]>;
20652065
defm :
2066-
RVVConvBuiltinSet<"vfncvt_f_xu_w", "csi", [["Fv", "FvUw"]]>;
2066+
RVVConvBuiltinSet<"vfncvt_f_xu_w", "si", [["Fv", "FvUw"]]>;
20672067
}
20682068
let OverloadedName = "vfncvt_f" in {
20692069
defm : RVVConvBuiltinSet<"vfncvt_f_f_w", "f", [["v", "vw"]]>;

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8455,8 +8455,8 @@ def source_date_epoch : Separate<["-"], "source-date-epoch">,
84558455
} // let Visibility = [CC1Option]
84568456

84578457
defm err_pragma_mc_func_aix : BoolFOption<"err-pragma-mc-func-aix",
8458-
PreprocessorOpts<"ErrorOnPragmaMcfuncOnAIX">, DefaultTrue,
8459-
PosFlag<SetTrue, [], [ClangOption],
8458+
PreprocessorOpts<"ErrorOnPragmaMcfuncOnAIX">, DefaultFalse,
8459+
PosFlag<SetTrue, [], [ClangOption, CC1Option],
84608460
"Treat uses of #pragma mc_func as errors">,
84618461
NegFlag<SetFalse,[], [ClangOption, CC1Option],
84628462
"Ignore uses of #pragma mc_func">>;

clang/include/clang/Lex/PreprocessorOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class PreprocessorOptions {
214214

215215
/// If set, the preprocessor reports an error when processing #pragma mc_func
216216
/// on AIX.
217-
bool ErrorOnPragmaMcfuncOnAIX = true;
217+
bool ErrorOnPragmaMcfuncOnAIX = false;
218218

219219
public:
220220
PreprocessorOptions() : PrecompiledPreambleBytes(0, false) {}
@@ -253,7 +253,7 @@ class PreprocessorOptions {
253253
PrecompiledPreambleBytes.first = 0;
254254
PrecompiledPreambleBytes.second = false;
255255
RetainExcludedConditionalBlocks = false;
256-
ErrorOnPragmaMcfuncOnAIX = true;
256+
ErrorOnPragmaMcfuncOnAIX = false;
257257
}
258258
};
259259

clang/lib/Analysis/FlowSensitive/Models/ChromiumCheckModel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ bool ChromiumCheckModel::transfer(const CFGElement &Element, Environment &Env) {
5656
return false;
5757
auto Stmt = CS->getStmt();
5858
if (const auto *Call = dyn_cast<CallExpr>(Stmt)) {
59-
if (const auto *M = dyn_cast<CXXMethodDecl>(Call->getDirectCallee())) {
59+
if (const auto *M =
60+
dyn_cast_or_null<CXXMethodDecl>(Call->getDirectCallee())) {
6061
if (isCheckLikeMethod(CheckDecls, *M)) {
6162
// Mark this branch as unreachable.
6263
Env.assume(Env.arena().makeLiteral(false));

clang/lib/Basic/Builtins.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ static bool builtinIsSupported(const Builtin::Info &BuiltinInfo,
9090
/* MSMode Unsupported */
9191
if (!LangOpts.MicrosoftExt && (BuiltinInfo.Langs & MS_LANG))
9292
return false;
93+
/* HLSLMode Unsupported */
94+
if (!LangOpts.HLSL && (BuiltinInfo.Langs & HLSL_LANG))
95+
return false;
9396
/* ObjC Unsupported */
9497
if (!LangOpts.ObjC && BuiltinInfo.Langs == OBJC_LANG)
9598
return false;

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18478,14 +18478,14 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
1847818478
return nullptr;
1847918479

1848018480
switch (BuiltinID) {
18481-
case Builtin::BI__builtin_hlsl_elementwise_all: {
18481+
case Builtin::BI__builtin_hlsl_all: {
1848218482
Value *Op0 = EmitScalarExpr(E->getArg(0));
1848318483
return Builder.CreateIntrinsic(
1848418484
/*ReturnType=*/llvm::Type::getInt1Ty(getLLVMContext()),
1848518485
CGM.getHLSLRuntime().getAllIntrinsic(), ArrayRef<Value *>{Op0}, nullptr,
1848618486
"hlsl.all");
1848718487
}
18488-
case Builtin::BI__builtin_hlsl_elementwise_any: {
18488+
case Builtin::BI__builtin_hlsl_any: {
1848918489
Value *Op0 = EmitScalarExpr(E->getArg(0));
1849018490
return Builder.CreateIntrinsic(
1849118491
/*ReturnType=*/llvm::Type::getInt1Ty(getLLVMContext()),

clang/lib/CodeGen/Targets/X86.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,10 @@ ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty, CCState &State,
795795
if (!IsWin32StructABI && isEmptyRecord(getContext(), Ty, true))
796796
return ABIArgInfo::getIgnore();
797797

798+
// Ignore 0 sized structs.
799+
if (TI.Width == 0)
800+
return ABIArgInfo::getIgnore();
801+
798802
llvm::LLVMContext &LLVMContext = getVMContext();
799803
llvm::IntegerType *Int32 = llvm::Type::getInt32Ty(LLVMContext);
800804
bool NeedsPadding = false;

clang/lib/Driver/ToolChains/AIX.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,10 @@ void AIX::addClangTargetOptions(
561561
options::OPT_fno_sized_deallocation))
562562
CC1Args.push_back("-fno-sized-deallocation");
563563

564-
if (!Args.hasFlag(options::OPT_ferr_pragma_mc_func_aix,
565-
options::OPT_fno_err_pragma_mc_func_aix, true))
564+
if (Args.hasFlag(options::OPT_ferr_pragma_mc_func_aix,
565+
options::OPT_fno_err_pragma_mc_func_aix, false))
566+
CC1Args.push_back("-ferr-pragma-mc-func-aix");
567+
else
566568
CC1Args.push_back("-fno-err-pragma-mc-func-aix");
567569
}
568570

clang/lib/Driver/ToolChains/BareMetal.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,11 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
487487
CmdArgs.push_back(Arch == llvm::Triple::aarch64_be ? "-EB" : "-EL");
488488
}
489489

490+
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
491+
options::OPT_r)) {
492+
CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt0.o")));
493+
}
494+
490495
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
491496
options::OPT_s, options::OPT_t, options::OPT_r});
492497

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,17 +3682,17 @@ static bool isFunctionDeclarationName(const LangOptions &LangOpts,
36823682
const FormatToken &Current,
36833683
const AnnotatedLine &Line,
36843684
FormatToken *&ClosingParen) {
3685-
assert(Current.Previous);
3686-
36873685
if (Current.is(TT_FunctionDeclarationName))
36883686
return true;
36893687

36903688
if (!Current.Tok.getIdentifierInfo())
36913689
return false;
36923690

3693-
const auto &Previous = *Current.Previous;
3691+
const auto *Prev = Current.getPreviousNonComment();
3692+
assert(Prev);
3693+
const auto &Previous = *Prev;
36943694

3695-
if (const auto *PrevPrev = Previous.Previous;
3695+
if (const auto *PrevPrev = Previous.getPreviousNonComment();
36963696
PrevPrev && PrevPrev->is(TT_ObjCDecl)) {
36973697
return false;
36983698
}
@@ -3859,20 +3859,20 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
38593859
First->TotalLength = First->IsMultiline
38603860
? Style.ColumnLimit
38613861
: Line.FirstStartColumn + First->ColumnWidth;
3862-
FormatToken *Current = First->Next;
3863-
bool InFunctionDecl = Line.MightBeFunctionDecl;
38643862
bool AlignArrayOfStructures =
38653863
(Style.AlignArrayOfStructures != FormatStyle::AIAS_None &&
38663864
Line.Type == LT_ArrayOfStructInitializer);
38673865
if (AlignArrayOfStructures)
38683866
calculateArrayInitializerColumnList(Line);
38693867

3868+
const auto *FirstNonComment = Line.getFirstNonComment();
38703869
bool SeenName = false;
38713870
bool LineIsFunctionDeclaration = false;
3872-
FormatToken *ClosingParen = nullptr;
38733871
FormatToken *AfterLastAttribute = nullptr;
3872+
FormatToken *ClosingParen = nullptr;
38743873

3875-
for (auto *Tok = Current; Tok; Tok = Tok->Next) {
3874+
for (auto *Tok = FirstNonComment ? FirstNonComment->Next : nullptr; Tok;
3875+
Tok = Tok->Next) {
38763876
if (Tok->is(TT_StartOfName))
38773877
SeenName = true;
38783878
if (Tok->Previous->EndsCppAttributeGroup)
@@ -3894,7 +3894,9 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
38943894
}
38953895
}
38963896

3897-
if (IsCpp && (LineIsFunctionDeclaration || First->is(TT_CtorDtorDeclName)) &&
3897+
if (IsCpp &&
3898+
(LineIsFunctionDeclaration ||
3899+
(FirstNonComment && FirstNonComment->is(TT_CtorDtorDeclName))) &&
38983900
Line.endsWith(tok::semi, tok::r_brace)) {
38993901
auto *Tok = Line.Last->Previous;
39003902
while (Tok->isNot(tok::r_brace))
@@ -3917,7 +3919,7 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
39173919
if (IsCpp) {
39183920
if (!LineIsFunctionDeclaration) {
39193921
// Annotate */&/&& in `operator` function calls as binary operators.
3920-
for (const auto *Tok = First; Tok; Tok = Tok->Next) {
3922+
for (const auto *Tok = FirstNonComment; Tok; Tok = Tok->Next) {
39213923
if (Tok->isNot(tok::kw_operator))
39223924
continue;
39233925
do {
@@ -3960,7 +3962,8 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
39603962
}
39613963
}
39623964

3963-
while (Current) {
3965+
bool InFunctionDecl = Line.MightBeFunctionDecl;
3966+
for (auto *Current = First->Next; Current; Current = Current->Next) {
39643967
const FormatToken *Prev = Current->Previous;
39653968
if (Current->is(TT_LineComment)) {
39663969
if (Prev->is(BK_BracedInit) && Prev->opensScope()) {
@@ -4050,13 +4053,11 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const {
40504053
} else {
40514054
Current->SplitPenalty += 20 * Current->BindingStrength;
40524055
}
4053-
4054-
Current = Current->Next;
40554056
}
40564057

40574058
calculateUnbreakableTailLengths(Line);
40584059
unsigned IndentLevel = Line.Level;
4059-
for (Current = First; Current; Current = Current->Next) {
4060+
for (auto *Current = First; Current; Current = Current->Next) {
40604061
if (Current->Role)
40614062
Current->Role->precomputeFormattingInfos(Current);
40624063
if (Current->MatchingParen &&

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,6 +2534,7 @@ bool UnwrappedLineParser::parseBracedList(bool IsAngleBracket, bool IsEnum) {
25342534
bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
25352535
assert(FormatTok->is(tok::l_paren) && "'(' expected.");
25362536
auto *LeftParen = FormatTok;
2537+
bool SeenComma = false;
25372538
bool SeenEqual = false;
25382539
bool MightBeFoldExpr = false;
25392540
const bool MightBeStmtExpr = Tokens->peekNextToken()->is(tok::l_brace);
@@ -2553,10 +2554,14 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
25532554
const auto *Next = Tokens->peekNextToken();
25542555
const bool DoubleParens =
25552556
Prev && Prev->is(tok::l_paren) && Next && Next->is(tok::r_paren);
2557+
const bool CommaSeparated =
2558+
!DoubleParens && Prev && Prev->isOneOf(tok::l_paren, tok::comma) &&
2559+
Next && Next->isOneOf(tok::comma, tok::r_paren);
25562560
const auto *PrevPrev = Prev ? Prev->getPreviousNonComment() : nullptr;
2557-
const bool Disallowed =
2561+
const bool Excluded =
25582562
PrevPrev &&
25592563
(PrevPrev->isOneOf(tok::kw___attribute, tok::kw_decltype) ||
2564+
SeenComma ||
25602565
(SeenEqual &&
25612566
(PrevPrev->isOneOf(tok::kw_if, tok::kw_while) ||
25622567
PrevPrev->endsSequence(tok::kw_constexpr, tok::kw_if))));
@@ -2566,7 +2571,8 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
25662571
(!NestedLambdas.empty() && !NestedLambdas.back())) &&
25672572
Prev && Prev->isOneOf(tok::kw_return, tok::kw_co_return) && Next &&
25682573
Next->is(tok::semi);
2569-
if ((DoubleParens && !Disallowed) || ReturnParens) {
2574+
if ((DoubleParens && !Excluded) || (CommaSeparated && !SeenComma) ||
2575+
ReturnParens) {
25702576
LeftParen->Optional = true;
25712577
FormatTok->Optional = true;
25722578
}
@@ -2595,6 +2601,10 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
25952601
parseBracedList();
25962602
}
25972603
break;
2604+
case tok::comma:
2605+
SeenComma = true;
2606+
nextToken();
2607+
break;
25982608
case tok::ellipsis:
25992609
MightBeFoldExpr = true;
26002610
nextToken();

0 commit comments

Comments
 (0)