Skip to content

Commit b245fb7

Browse files
committed
rebase
Created using spr 1.3.4
2 parents 99b57ac + b63e932 commit b245fb7

File tree

365 files changed

+19077
-5133
lines changed

Some content is hidden

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

365 files changed

+19077
-5133
lines changed

clang-tools-extra/clang-doc/Generators.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,8 @@ std::string getTagType(TagTypeKind AS);
5555
} // namespace doc
5656
} // namespace clang
5757

58+
namespace llvm {
59+
extern template class Registry<clang::doc::Generator>;
60+
} // namespace llvm
61+
5862
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_GENERATOR_H

clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ using ClangTidyModuleRegistry = llvm::Registry<ClangTidyModule>;
1818

1919
} // namespace clang::tidy
2020

21+
namespace llvm {
22+
extern template class Registry<clang::tidy::ClangTidyModule>;
23+
} // namespace llvm
24+
2125
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H

clang-tools-extra/clangd/URI.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,8 @@ typedef llvm::Registry<URIScheme> URISchemeRegistry;
133133
} // namespace clangd
134134
} // namespace clang
135135

136+
namespace llvm {
137+
extern template class Registry<clang::clangd::URIScheme>;
138+
} // namespace llvm
139+
136140
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_URI_H

clang-tools-extra/clangd/refactor/Tweak.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,8 @@ prepareTweak(StringRef ID, const Tweak::Selection &S,
147147
} // namespace clangd
148148
} // namespace clang
149149

150+
namespace llvm {
151+
extern template class Registry<clang::clangd::Tweak>;
152+
} // namespace llvm
153+
150154
#endif

clang-tools-extra/docs/clang-tidy/checks/bugprone/unchecked-optional-access.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ For example:
7676
}
7777
}
7878
79+
Exception: accessor methods
80+
```````````````````````````
81+
82+
The check assumes *accessor* methods of a class are stable, with a heuristic to
83+
determine which methods are accessors. Specifically, parameter-free ``const``
84+
methods are treated as accessors. Note that this is not guaranteed to be safe
85+
-- but, it is widely used (safely) in practice, and so we have chosen to treat
86+
it as generally safe. Calls to non ``const`` methods are assumed to modify
87+
the state of the object and affect the stability of earlier accessor calls.
88+
7989
Rely on invariants of uncommon APIs
8090
-----------------------------------
8191

clang-tools-extra/include-cleaner/include/clang-include-cleaner/IncludeSpeller.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ using IncludeSpellingStrategy = llvm::Registry<IncludeSpeller>;
4646
std::string spellHeader(const IncludeSpeller::Input &Input);
4747
} // namespace clang::include_cleaner
4848

49+
namespace llvm {
50+
extern template class Registry<clang::include_cleaner::IncludeSpeller>;
51+
} // namespace llvm
52+
4953
#endif

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ Bug Fixes in This Version
439439
- Fixed a crash when trying to transform a dependent address space type. Fixes #GH101685.
440440
- Fixed a crash when diagnosing format strings and encountering an empty
441441
delimited escape sequence (e.g., ``"\o{}"``). #GH102218
442+
- Fixed a crash using ``__array_rank`` on 64-bit targets. (#GH113044).
442443
- The warning emitted for an unsupported register variable type now points to
443444
the unsupported type instead of the ``register`` keyword (#GH109776).
444445

@@ -507,7 +508,7 @@ Bug Fixes to C++ Support
507508
- Clang no longer tries to capture non-odr used default arguments of template parameters of generic lambdas (#GH107048)
508509
- Fixed a bug where defaulted comparison operators would remove ``const`` from base classes. (#GH102588)
509510
- Fix a crash when using ``source_location`` in the trailing return type of a lambda expression. (#GH67134)
510-
- A follow-up fix was added for (#GH61460), as the previous fix was not entirely correct. (#GH86361)
511+
- A follow-up fix was added for (#GH61460), as the previous fix was not entirely correct. (#GH86361), (#GH112352)
511512
- Fixed a crash in the typo correction of an invalid CTAD guide. (#GH107887)
512513
- Fixed a crash when clang tries to subtitute parameter pack while retaining the parameter
513514
pack. (#GH63819), (#GH107560)
@@ -539,6 +540,9 @@ Bug Fixes to C++ Support
539540
- Fix erroneous templated array size calculation leading to crashes in generated code. (#GH41441)
540541
- During the lookup for a base class name, non-type names are ignored. (#GH16855)
541542
- Fix a crash when recovering an invalid expression involving an explicit object member conversion operator. (#GH112559)
543+
- Clang incorrectly considered a class with an anonymous union member to not be
544+
const-default-constructible even if a union member has a default member initializer.
545+
(#GH95854).
542546

543547
Bug Fixes to AST Handling
544548
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "clang/AST/ASTContext.h"
1818
#include "clang/Analysis/CFG.h"
1919
#include "clang/Analysis/FlowSensitive/CFGMatchSwitch.h"
20+
#include "clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h"
2021
#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h"
2122
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
2223
#include "clang/Analysis/FlowSensitive/NoopLattice.h"
@@ -39,23 +40,28 @@ struct UncheckedOptionalAccessModelOptions {
3940
bool IgnoreSmartPointerDereference = false;
4041
};
4142

43+
using UncheckedOptionalAccessLattice = CachedConstAccessorsLattice<NoopLattice>;
44+
4245
/// Dataflow analysis that models whether optionals hold values or not.
4346
///
4447
/// Models the `std::optional`, `absl::optional`, and `base::Optional` types.
4548
class UncheckedOptionalAccessModel
46-
: public DataflowAnalysis<UncheckedOptionalAccessModel, NoopLattice> {
49+
: public DataflowAnalysis<UncheckedOptionalAccessModel,
50+
UncheckedOptionalAccessLattice> {
4751
public:
4852
UncheckedOptionalAccessModel(ASTContext &Ctx, dataflow::Environment &Env);
4953

5054
/// Returns a matcher for the optional classes covered by this model.
5155
static ast_matchers::DeclarationMatcher optionalClassDecl();
5256

53-
static NoopLattice initialElement() { return {}; }
57+
static UncheckedOptionalAccessLattice initialElement() { return {}; }
5458

55-
void transfer(const CFGElement &Elt, NoopLattice &L, Environment &Env);
59+
void transfer(const CFGElement &Elt, UncheckedOptionalAccessLattice &L,
60+
Environment &Env);
5661

5762
private:
58-
CFGMatchSwitch<TransferState<NoopLattice>> TransferMatchSwitch;
63+
CFGMatchSwitch<TransferState<UncheckedOptionalAccessLattice>>
64+
TransferMatchSwitch;
5965
};
6066

6167
class UncheckedOptionalAccessDiagnoser {
@@ -65,7 +71,8 @@ class UncheckedOptionalAccessDiagnoser {
6571

6672
llvm::SmallVector<SourceLocation>
6773
operator()(const CFGElement &Elt, ASTContext &Ctx,
68-
const TransferStateForDiagnostics<NoopLattice> &State) {
74+
const TransferStateForDiagnostics<UncheckedOptionalAccessLattice>
75+
&State) {
6976
return DiagnoseMatchSwitch(Elt, Ctx, State.Env);
7077
}
7178

clang/include/clang/Basic/AttrDocs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2669,7 +2669,7 @@ sign. For example:
26692669

26702670
.. code-block:: c++
26712671

2672-
__attribute__((target_clones("sha2+memtag2", "fcma+sve2-pmull128")))
2672+
__attribute__((target_clones("sha2+memtag", "fcma+sve2-pmull128")))
26732673
void foo() {}
26742674

26752675
For every multiversioned function a ``default`` (fallback) implementation

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10188,7 +10188,7 @@ def warn_new_dangling_initializer_list : Warning<
1018810188
"will be destroyed at the end of the full-expression">,
1018910189
InGroup<DanglingInitializerList>;
1019010190
def warn_dangling_pointer_assignment : Warning<
10191-
"object backing the pointer %0 "
10191+
"object backing %select{|the pointer }0%1 "
1019210192
"will be destroyed at the end of the full-expression">,
1019310193
InGroup<DanglingAssignment>;
1019410194

0 commit comments

Comments
 (0)