Skip to content

Commit 1d79c13

Browse files
authored
Merge branch 'main' into command
2 parents 42e7a62 + 68578b3 commit 1d79c13

File tree

222 files changed

+7086
-2731
lines changed

Some content is hidden

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

222 files changed

+7086
-2731
lines changed

.github/workflows/issue-write.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: 'Comment on PR'
4141
if: steps.download-artifact.outputs.artifact-id != ''
42-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
42+
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3.2.0
4343
with:
4444
github-token: ${{ secrets.GITHUB_TOKEN }}
4545
script: |

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ AST Dumping Potentially Breaking Changes
6262
Clang Frontend Potentially Breaking Changes
6363
-------------------------------------------
6464

65+
- The ``-Wglobal-constructors`` flag now applies to ``[[gnu::constructor]]`` and
66+
``[[gnu::destructor]]`` attributes.
67+
6568
Clang Python Bindings Potentially Breaking Changes
6669
--------------------------------------------------
6770

@@ -245,6 +248,7 @@ Bug Fixes in This Version
245248

246249
- Clang now outputs correct values when #embed data contains bytes with negative
247250
signed char values (#GH102798).
251+
- Fixed a crash when merging named enumerations in modules (#GH114240).
248252
- Fixed rejects-valid problem when #embed appears in std::initializer_list or
249253
when it can affect template argument deduction (#GH122306).
250254
- Fix crash on code completion of function calls involving partial order of function templates
@@ -296,6 +300,7 @@ Improvements to C++ diagnostics
296300
Bug Fixes to AST Handling
297301
^^^^^^^^^^^^^^^^^^^^^^^^^
298302
- Fixed type checking when a statement expression ends in an l-value of atomic type. (#GH106576)
303+
- Fixed uninitialized use check in a lambda within CXXOperatorCallExpr. (#GH129198)
299304

300305
Miscellaneous Bug Fixes
301306
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def err_decomp_decl_constraint : Error<
551551
def err_decomp_decl_parens : Error<
552552
"decomposition declaration cannot be declared with parentheses">;
553553
def err_decomp_decl_template : Error<
554-
"decomposition declaration template not supported">;
554+
"decomposition declaration cannot be a template">;
555555
def err_decomp_decl_not_alone : Error<
556556
"decomposition declaration must be the only declaration in its group">;
557557
def err_decomp_decl_requires_init : Error<

clang/include/clang/Sema/Sema.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4008,7 +4008,7 @@ class Sema final : public SemaBase {
40084008
/// Perform ODR-like check for C/ObjC when merging tag types from modules.
40094009
/// Differently from C++, actually parse the body and reject / error out
40104010
/// in case of a structural mismatch.
4011-
bool ActOnDuplicateDefinition(Decl *Prev, SkipBodyInfo &SkipBody);
4011+
bool ActOnDuplicateDefinition(Scope *S, Decl *Prev, SkipBodyInfo &SkipBody);
40124012

40134013
typedef void *SkippedDefinitionContext;
40144014

@@ -4132,6 +4132,12 @@ class Sema final : public SemaBase {
41324132
void MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
41334133
LookupResult &OldDecls);
41344134

4135+
/// CleanupMergedEnum - We have just merged the decl 'New' by making another
4136+
/// definition visible.
4137+
/// This method performs any necessary cleanup on the parser state to discard
4138+
/// child nodes from newly parsed decl we are retiring.
4139+
void CleanupMergedEnum(Scope *S, Decl *New);
4140+
41354141
/// MergeFunctionDecl - We just parsed a function 'New' from
41364142
/// declarator D which has the same name and scope as a previous
41374143
/// declaration 'Old'. Figure out how to resolve this situation,

clang/lib/CodeGen/Targets/RISCV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ ABIArgInfo RISCVABIInfo::coerceAndExpandFPCCEligibleStruct(
389389
bool RISCVABIInfo::detectVLSCCEligibleStruct(QualType Ty, unsigned ABIVLen,
390390
llvm::Type *&VLSType) const {
391391
// No riscv_vls_cc attribute.
392-
if (ABIVLen == 1)
392+
if (ABIVLen == 0)
393393
return false;
394394

395395
// Legal struct for VLS calling convention should fulfill following rules:

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,7 @@ std::string CUIDOptions::getCUID(StringRef InputFile,
226226
else if (UseCUID == Kind::Hash) {
227227
llvm::MD5 Hasher;
228228
llvm::MD5::MD5Result Hash;
229-
SmallString<256> RealPath;
230-
llvm::sys::fs::real_path(InputFile, RealPath,
231-
/*expand_tilde=*/true);
232-
Hasher.update(RealPath);
229+
Hasher.update(InputFile);
233230
for (auto *A : Args) {
234231
if (A->getOption().matches(options::OPT_INPUT))
235232
continue;

clang/lib/Format/UnwrappedLineFormatter.cpp

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,36 +116,18 @@ class LevelIndentTracker {
116116
Style.isCSharp()) {
117117
return 0;
118118
}
119-
120-
auto IsAccessModifier = [&](const FormatToken &RootToken) {
121-
if (Line.Type == LT_AccessModifier || RootToken.isObjCAccessSpecifier())
122-
return true;
123-
124-
const auto *Next = RootToken.Next;
125-
126-
// Handle Qt signals.
127-
if (RootToken.isOneOf(Keywords.kw_signals, Keywords.kw_qsignals) &&
128-
Next && Next->is(tok::colon)) {
129-
return true;
130-
}
131-
132-
if (Next && Next->isOneOf(Keywords.kw_slots, Keywords.kw_qslots) &&
133-
Next->Next && Next->Next->is(tok::colon)) {
134-
return true;
135-
}
136-
137-
// Handle malformed access specifier e.g. 'private' without trailing ':'.
138-
return !Next && RootToken.isAccessSpecifier(false);
139-
};
140-
141-
if (IsAccessModifier(*Line.First)) {
119+
const auto &RootToken = *Line.First;
120+
if (Line.Type == LT_AccessModifier ||
121+
RootToken.isAccessSpecifier(/*ColonRequired=*/false) ||
122+
RootToken.isObjCAccessSpecifier() ||
123+
(RootToken.isOneOf(Keywords.kw_signals, Keywords.kw_qsignals) &&
124+
RootToken.Next && RootToken.Next->is(tok::colon))) {
142125
// The AccessModifierOffset may be overridden by IndentAccessModifiers,
143126
// in which case we take a negative value of the IndentWidth to simulate
144127
// the upper indent level.
145128
return Style.IndentAccessModifiers ? -Style.IndentWidth
146129
: Style.AccessModifierOffset;
147130
}
148-
149131
return 0;
150132
}
151133

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3386,75 +3386,15 @@ void UnwrappedLineParser::parseSwitch(bool IsExpr) {
33863386
NestedTooDeep.pop_back();
33873387
}
33883388

3389-
// Operators that can follow a C variable.
3390-
static bool isCOperatorFollowingVar(tok::TokenKind Kind) {
3391-
switch (Kind) {
3392-
case tok::ampamp:
3393-
case tok::ampequal:
3394-
case tok::arrow:
3395-
case tok::caret:
3396-
case tok::caretequal:
3397-
case tok::comma:
3398-
case tok::ellipsis:
3399-
case tok::equal:
3400-
case tok::equalequal:
3401-
case tok::exclaim:
3402-
case tok::exclaimequal:
3403-
case tok::greater:
3404-
case tok::greaterequal:
3405-
case tok::greatergreater:
3406-
case tok::greatergreaterequal:
3407-
case tok::l_paren:
3408-
case tok::l_square:
3409-
case tok::less:
3410-
case tok::lessequal:
3411-
case tok::lessless:
3412-
case tok::lesslessequal:
3413-
case tok::minus:
3414-
case tok::minusequal:
3415-
case tok::minusminus:
3416-
case tok::percent:
3417-
case tok::percentequal:
3418-
case tok::period:
3419-
case tok::pipe:
3420-
case tok::pipeequal:
3421-
case tok::pipepipe:
3422-
case tok::plus:
3423-
case tok::plusequal:
3424-
case tok::plusplus:
3425-
case tok::question:
3426-
case tok::r_brace:
3427-
case tok::r_paren:
3428-
case tok::r_square:
3429-
case tok::semi:
3430-
case tok::slash:
3431-
case tok::slashequal:
3432-
case tok::star:
3433-
case tok::starequal:
3434-
return true;
3435-
default:
3436-
return false;
3437-
}
3438-
}
3439-
34403389
void UnwrappedLineParser::parseAccessSpecifier() {
3441-
FormatToken *AccessSpecifierCandidate = FormatTok;
34423390
nextToken();
34433391
// Understand Qt's slots.
34443392
if (FormatTok->isOneOf(Keywords.kw_slots, Keywords.kw_qslots))
34453393
nextToken();
34463394
// Otherwise, we don't know what it is, and we'd better keep the next token.
3447-
if (FormatTok->is(tok::colon)) {
3395+
if (FormatTok->is(tok::colon))
34483396
nextToken();
3449-
addUnwrappedLine();
3450-
} else if (FormatTok->isNot(tok::coloncolon) &&
3451-
!isCOperatorFollowingVar(FormatTok->Tok.getKind())) {
3452-
// Not a variable name nor namespace name.
3453-
addUnwrappedLine();
3454-
} else if (AccessSpecifierCandidate) {
3455-
// Consider the access specifier to be a C identifier.
3456-
AccessSpecifierCandidate->Tok.setKind(tok::identifier);
3457-
}
3397+
addUnwrappedLine();
34583398
}
34593399

34603400
/// \brief Parses a requires, decides if it is a clause or an expression.

clang/lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5652,7 +5652,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
56525652
Decl *D = SkipBody.CheckSameAsPrevious ? SkipBody.New : TagDecl;
56535653
ParseEnumBody(StartLoc, D);
56545654
if (SkipBody.CheckSameAsPrevious &&
5655-
!Actions.ActOnDuplicateDefinition(TagDecl, SkipBody)) {
5655+
!Actions.ActOnDuplicateDefinition(getCurScope(), TagDecl, SkipBody)) {
56565656
DS.SetTypeSpecError();
56575657
return;
56585658
}

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2350,7 +2350,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
23502350
// Parse the definition body.
23512351
ParseStructUnionBody(StartLoc, TagType, cast<RecordDecl>(D));
23522352
if (SkipBody.CheckSameAsPrevious &&
2353-
!Actions.ActOnDuplicateDefinition(TagOrTempResult.get(), SkipBody)) {
2353+
!Actions.ActOnDuplicateDefinition(getCurScope(),
2354+
TagOrTempResult.get(), SkipBody)) {
23542355
DS.SetTypeSpecError();
23552356
return;
23562357
}

0 commit comments

Comments
 (0)