Skip to content

Commit d6fc0fb

Browse files
authored
Merge branch 'main' into tablegen/decoder/fixme-operand-decoded-as-inst
2 parents fdc2823 + 1d05d69 commit d6fc0fb

File tree

737 files changed

+23858
-9201
lines changed

Some content is hidden

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

737 files changed

+23858
-9201
lines changed

.ci/monolithic-linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6060
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
6161
-D LLDB_ENABLE_PYTHON=ON \
6262
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
63-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
63+
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
64+
-D CMAKE_EXE_LINKER_FLAGS="-no-pie"
6465

6566
start-group "ninja"
6667

clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4532,6 +4532,139 @@ TEST(CompletionTest, MemberAccessInExplicitObjMemfn) {
45324532
EXPECT_THAT(Result.Completions, ElementsAre());
45334533
}
45344534
}
4535+
4536+
TEST(CompletionTest, ListExplicitObjectOverloads) {
4537+
Annotations Code(R"cpp(
4538+
struct S {
4539+
void foo1(int a);
4540+
void foo2(int a) const;
4541+
void foo2(this const S& self, float a);
4542+
void foo3(this const S& self, int a);
4543+
void foo4(this S& self, int a);
4544+
};
4545+
4546+
void S::foo1(int a) {
4547+
this->$c1^;
4548+
}
4549+
4550+
void S::foo2(int a) const {
4551+
this->$c2^;
4552+
}
4553+
4554+
void S::foo3(this const S& self, int a) {
4555+
self.$c3^;
4556+
}
4557+
4558+
void S::foo4(this S& self, int a) {
4559+
self.$c4^;
4560+
}
4561+
4562+
void test1(S s) {
4563+
s.$c5^;
4564+
}
4565+
4566+
void test2(const S s) {
4567+
s.$c6^;
4568+
}
4569+
)cpp");
4570+
4571+
auto TU = TestTU::withCode(Code.code());
4572+
TU.ExtraArgs = {"-std=c++23"};
4573+
4574+
auto Preamble = TU.preamble();
4575+
ASSERT_TRUE(Preamble);
4576+
4577+
CodeCompleteOptions Opts{};
4578+
4579+
MockFS FS;
4580+
auto Inputs = TU.inputs(FS);
4581+
4582+
{
4583+
auto Result = codeComplete(testPath(TU.Filename), Code.point("c1"),
4584+
Preamble.get(), Inputs, Opts);
4585+
EXPECT_THAT(
4586+
Result.Completions,
4587+
UnorderedElementsAre(AllOf(named("foo1"), signature("(int a)"),
4588+
snippetSuffix("(${1:int a})")),
4589+
AllOf(named("foo2"), signature("(int a) const"),
4590+
snippetSuffix("(${1:int a})")),
4591+
AllOf(named("foo2"), signature("(float a) const"),
4592+
snippetSuffix("(${1:float a})")),
4593+
AllOf(named("foo3"), signature("(int a) const"),
4594+
snippetSuffix("(${1:int a})")),
4595+
AllOf(named("foo4"), signature("(int a)"),
4596+
snippetSuffix("(${1:int a})"))));
4597+
}
4598+
{
4599+
auto Result = codeComplete(testPath(TU.Filename), Code.point("c2"),
4600+
Preamble.get(), Inputs, Opts);
4601+
EXPECT_THAT(
4602+
Result.Completions,
4603+
UnorderedElementsAre(AllOf(named("foo2"), signature("(int a) const"),
4604+
snippetSuffix("(${1:int a})")),
4605+
AllOf(named("foo2"), signature("(float a) const"),
4606+
snippetSuffix("(${1:float a})")),
4607+
AllOf(named("foo3"), signature("(int a) const"),
4608+
snippetSuffix("(${1:int a})"))));
4609+
}
4610+
{
4611+
auto Result = codeComplete(testPath(TU.Filename), Code.point("c3"),
4612+
Preamble.get(), Inputs, Opts);
4613+
EXPECT_THAT(
4614+
Result.Completions,
4615+
UnorderedElementsAre(AllOf(named("foo2"), signature("(int a) const"),
4616+
snippetSuffix("(${1:int a})")),
4617+
AllOf(named("foo2"), signature("(float a) const"),
4618+
snippetSuffix("(${1:float a})")),
4619+
AllOf(named("foo3"), signature("(int a) const"),
4620+
snippetSuffix("(${1:int a})"))));
4621+
}
4622+
{
4623+
auto Result = codeComplete(testPath(TU.Filename), Code.point("c4"),
4624+
Preamble.get(), Inputs, Opts);
4625+
EXPECT_THAT(
4626+
Result.Completions,
4627+
UnorderedElementsAre(AllOf(named("foo1"), signature("(int a)"),
4628+
snippetSuffix("(${1:int a})")),
4629+
AllOf(named("foo2"), signature("(int a) const"),
4630+
snippetSuffix("(${1:int a})")),
4631+
AllOf(named("foo2"), signature("(float a) const"),
4632+
snippetSuffix("(${1:float a})")),
4633+
AllOf(named("foo3"), signature("(int a) const"),
4634+
snippetSuffix("(${1:int a})")),
4635+
AllOf(named("foo4"), signature("(int a)"),
4636+
snippetSuffix("(${1:int a})"))));
4637+
}
4638+
{
4639+
auto Result = codeComplete(testPath(TU.Filename), Code.point("c5"),
4640+
Preamble.get(), Inputs, Opts);
4641+
EXPECT_THAT(
4642+
Result.Completions,
4643+
UnorderedElementsAre(AllOf(named("foo1"), signature("(int a)"),
4644+
snippetSuffix("(${1:int a})")),
4645+
AllOf(named("foo2"), signature("(int a) const"),
4646+
snippetSuffix("(${1:int a})")),
4647+
AllOf(named("foo2"), signature("(float a) const"),
4648+
snippetSuffix("(${1:float a})")),
4649+
AllOf(named("foo3"), signature("(int a) const"),
4650+
snippetSuffix("(${1:int a})")),
4651+
AllOf(named("foo4"), signature("(int a)"),
4652+
snippetSuffix("(${1:int a})"))));
4653+
}
4654+
{
4655+
auto Result = codeComplete(testPath(TU.Filename), Code.point("c6"),
4656+
Preamble.get(), Inputs, Opts);
4657+
EXPECT_THAT(
4658+
Result.Completions,
4659+
UnorderedElementsAre(AllOf(named("foo2"), signature("(int a) const"),
4660+
snippetSuffix("(${1:int a})")),
4661+
AllOf(named("foo2"), signature("(float a) const"),
4662+
snippetSuffix("(${1:float a})")),
4663+
AllOf(named("foo3"), signature("(int a) const"),
4664+
snippetSuffix("(${1:int a})"))));
4665+
}
4666+
}
4667+
45354668
} // namespace
45364669
} // namespace clangd
45374670
} // namespace clang

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ Changes in existing checks
215215

216216
- Improved :doc:`readability-identifier-naming
217217
<clang-tidy/checks/readability/identifier-naming>` check by ignoring
218-
declarations in system headers.
218+
declarations in system headers. The documentation is also improved to
219+
differentiate the general options from the specific ones.
219220

220221
- Improved :doc:`readability-qualified-auto
221222
<clang-tidy/checks/readability/qualified-auto>` check by adding the option

clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,21 @@ The options and their corresponding values are:
4343
- ``LowerCase`` - example: ``int i_Variable``
4444
- ``CamelCase`` - example: ``int IVariable``
4545

46-
Options
47-
-------
46+
Options summary
47+
---------------
4848

49-
The following options are described below:
49+
The available options are summarized below:
50+
51+
**General options**
5052

51-
- :option:`AbstractClassCase`, :option:`AbstractClassPrefix`, :option:`AbstractClassSuffix`, :option:`AbstractClassIgnoredRegexp`, :option:`AbstractClassHungarianPrefix`
5253
- :option:`AggressiveDependentMemberLookup`
5354
- :option:`CheckAnonFieldInParent`
55+
- :option:`GetConfigPerFile`
56+
- :option:`IgnoreMainLikeFunctions`
57+
58+
**Specific options**
59+
60+
- :option:`AbstractClassCase`, :option:`AbstractClassPrefix`, :option:`AbstractClassSuffix`, :option:`AbstractClassIgnoredRegexp`, :option:`AbstractClassHungarianPrefix`
5461
- :option:`ClassCase`, :option:`ClassPrefix`, :option:`ClassSuffix`, :option:`ClassIgnoredRegexp`, :option:`ClassHungarianPrefix`
5562
- :option:`ClassConstantCase`, :option:`ClassConstantPrefix`, :option:`ClassConstantSuffix`, :option:`ClassConstantIgnoredRegexp`, :option:`ClassConstantHungarianPrefix`
5663
- :option:`ClassMemberCase`, :option:`ClassMemberPrefix`, :option:`ClassMemberSuffix`, :option:`ClassMemberIgnoredRegexp`, :option:`ClassMemberHungarianPrefix`
@@ -66,13 +73,11 @@ The following options are described below:
6673
- :option:`EnumCase`, :option:`EnumPrefix`, :option:`EnumSuffix`, :option:`EnumIgnoredRegexp`
6774
- :option:`EnumConstantCase`, :option:`EnumConstantPrefix`, :option:`EnumConstantSuffix`, :option:`EnumConstantIgnoredRegexp`, :option:`EnumConstantHungarianPrefix`
6875
- :option:`FunctionCase`, :option:`FunctionPrefix`, :option:`FunctionSuffix`, :option:`FunctionIgnoredRegexp`
69-
- :option:`GetConfigPerFile`
7076
- :option:`GlobalConstantCase`, :option:`GlobalConstantPrefix`, :option:`GlobalConstantSuffix`, :option:`GlobalConstantIgnoredRegexp`, :option:`GlobalConstantHungarianPrefix`
7177
- :option:`GlobalConstantPointerCase`, :option:`GlobalConstantPointerPrefix`, :option:`GlobalConstantPointerSuffix`, :option:`GlobalConstantPointerIgnoredRegexp`, :option:`GlobalConstantPointerHungarianPrefix`
7278
- :option:`GlobalFunctionCase`, :option:`GlobalFunctionPrefix`, :option:`GlobalFunctionSuffix`, :option:`GlobalFunctionIgnoredRegexp`
7379
- :option:`GlobalPointerCase`, :option:`GlobalPointerPrefix`, :option:`GlobalPointerSuffix`, :option:`GlobalPointerIgnoredRegexp`, :option:`GlobalPointerHungarianPrefix`
7480
- :option:`GlobalVariableCase`, :option:`GlobalVariablePrefix`, :option:`GlobalVariableSuffix`, :option:`GlobalVariableIgnoredRegexp`, :option:`GlobalVariableHungarianPrefix`
75-
- :option:`IgnoreMainLikeFunctions`
7681
- :option:`InlineNamespaceCase`, :option:`InlineNamespacePrefix`, :option:`InlineNamespaceSuffix`, :option:`InlineNamespaceIgnoredRegexp`
7782
- :option:`LocalConstantCase`, :option:`LocalConstantPrefix`, :option:`LocalConstantSuffix`, :option:`LocalConstantIgnoredRegexp`, :option:`LocalConstantHungarianPrefix`
7883
- :option:`LocalConstantPointerCase`, :option:`LocalConstantPointerPrefix`, :option:`LocalConstantPointerSuffix`, :option:`LocalConstantPointerIgnoredRegexp`, :option:`LocalConstantPointerHungarianPrefix`
@@ -105,6 +110,12 @@ The following options are described below:
105110
- :option:`VariableCase`, :option:`VariablePrefix`, :option:`VariableSuffix`, :option:`VariableIgnoredRegexp`, :option:`VariableHungarianPrefix`
106111
- :option:`VirtualMethodCase`, :option:`VirtualMethodPrefix`, :option:`VirtualMethodSuffix`, :option:`VirtualMethodIgnoredRegexp`
107112

113+
114+
Options description
115+
-------------------
116+
117+
A detailed description of each option is presented below:
118+
108119
.. option:: AbstractClassCase
109120

110121
When defined, the check will ensure abstract class names conform to the

clang/docs/LanguageExtensions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,7 @@ Hexadecimal floating constants (N308) C
17631763
Compound literals (N716) C99 C89, C++
17641764
``//`` comments (N644) C99 C89
17651765
Mixed declarations and code (N740) C99 C89
1766+
init-statement in for (N740) C99 C89
17661767
Variadic macros (N707) C99 C89
17671768
Empty macro arguments (N570) C99 C89
17681769
Trailing comma in enum declaration C99 C89

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ Improvements to Clang's diagnostics
209209
potential misaligned members get processed before they can get discarded.
210210
(#GH144729)
211211

212+
- Fixed false positive in ``-Wmissing-noreturn`` diagnostic when it was requiring the usage of
213+
``[[noreturn]]`` on lambdas before C++23 (#GH154493).
214+
212215
Improvements to Clang's time-trace
213216
----------------------------------
214217

@@ -226,6 +229,7 @@ Bug Fixes in This Version
226229
cast chain. (#GH149967).
227230
- Fixed a crash with incompatible pointer to integer conversions in designated
228231
initializers involving string literals. (#GH154046)
232+
- Fixed scope of typedefs present inside a template class. (#GH91451)
229233

230234
Bug Fixes to Compiler Builtins
231235
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/AllDiagnostics.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@
2323
#include "clang/Basic/DiagnosticInstallAPI.h"
2424
#include "clang/Basic/DiagnosticLex.h"
2525
#include "clang/Basic/DiagnosticParse.h"
26+
#include "clang/Basic/DiagnosticRefactoring.h"
2627
#include "clang/Basic/DiagnosticSema.h"
2728
#include "clang/Basic/DiagnosticSerialization.h"
28-
#include "clang/Basic/DiagnosticRefactoring.h"
2929

3030
namespace clang {
31-
template <size_t SizeOfStr, typename FieldType>
32-
class StringSizerHelper {
31+
template <size_t SizeOfStr, typename FieldType> class StringSizerHelper {
3332
static_assert(SizeOfStr <= FieldType(~0U), "Field too small!");
33+
3434
public:
3535
enum { Size = SizeOfStr };
3636
};
3737
} // end namespace clang
3838

39-
#define STR_SIZE(str, fieldTy) clang::StringSizerHelper<sizeof(str)-1, \
40-
fieldTy>::Size
39+
#define STR_SIZE(str, fieldTy) \
40+
clang::StringSizerHelper<sizeof(str) - 1, fieldTy>::Size
4141

4242
#endif

0 commit comments

Comments
 (0)