Skip to content

Commit 255c341

Browse files
authored
Merge branch 'main' into 118218
2 parents 932764c + 3b74abd commit 255c341

File tree

1,575 files changed

+30824
-10100
lines changed

Some content is hidden

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

1,575 files changed

+30824
-10100
lines changed

.github/workflows/libcxx-restart-preempted-jobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145
with:
146146
script: |
147147
const FAILURE_REGEX = /Process completed with exit code 1./
148-
const PREEMPTION_REGEX = /The runner has received a shutdown signal|The operation was canceled/
148+
const PREEMPTION_REGEX = /(The runner has received a shutdown signal)|(The operation was canceled)/
149149
150150
function log(msg) {
151151
core.notice(msg)

clang-tools-extra/clangd/HeuristicResolver.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ const Type *resolveDeclsToType(const std::vector<const NamedDecl *> &Decls,
118118
return nullptr;
119119
}
120120

121+
TemplateName getReferencedTemplateName(const Type *T) {
122+
if (const auto *TST = T->getAs<TemplateSpecializationType>()) {
123+
return TST->getTemplateName();
124+
}
125+
if (const auto *DTST = T->getAs<DeducedTemplateSpecializationType>()) {
126+
return DTST->getTemplateName();
127+
}
128+
return TemplateName();
129+
}
130+
121131
// Helper function for HeuristicResolver::resolveDependentMember()
122132
// which takes a possibly-dependent type `T` and heuristically
123133
// resolves it to a CXXRecordDecl in which we can try name lookup.
@@ -142,12 +152,12 @@ CXXRecordDecl *HeuristicResolverImpl::resolveTypeToRecordDecl(const Type *T) {
142152
if (!T)
143153
return nullptr;
144154

145-
const auto *TST = T->getAs<TemplateSpecializationType>();
146-
if (!TST)
155+
TemplateName TN = getReferencedTemplateName(T);
156+
if (TN.isNull())
147157
return nullptr;
148158

149-
const ClassTemplateDecl *TD = dyn_cast_or_null<ClassTemplateDecl>(
150-
TST->getTemplateName().getAsTemplateDecl());
159+
const ClassTemplateDecl *TD =
160+
dyn_cast_or_null<ClassTemplateDecl>(TN.getAsTemplateDecl());
151161
if (!TD)
152162
return nullptr;
153163

clang-tools-extra/clangd/index/dex/Dex.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ class Dex : public SymbolIndex {
146146
// Set of files which were used during this index build.
147147
llvm::StringSet<> Files;
148148
// Contents of the index (symbols, references, etc.)
149+
// This is only populated if `Files` is, which applies to some but not all
150+
// consumers of this class.
149151
IndexContents IdxContents = IndexContents::None;
150152
// Size of memory retained by KeepAlive.
151153
size_t BackingDataSize = 0;

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,8 @@ TEST_F(TargetDeclTest, OverloadExpr) {
842842
}
843843

844844
TEST_F(TargetDeclTest, DependentExprs) {
845+
Flags.push_back("--std=c++20");
846+
845847
// Heuristic resolution of method of dependent field
846848
Code = R"cpp(
847849
struct A { void foo() {} };
@@ -962,6 +964,21 @@ TEST_F(TargetDeclTest, DependentExprs) {
962964
};
963965
)cpp";
964966
EXPECT_DECLS("MemberExpr", "void find()");
967+
968+
// Base expression is the type of a non-type template parameter
969+
// which is deduced using CTAD.
970+
Code = R"cpp(
971+
template <int N>
972+
struct Waldo {
973+
const int found = N;
974+
};
975+
976+
template <Waldo W>
977+
int test() {
978+
return W.[[found]];
979+
}
980+
)cpp";
981+
EXPECT_DECLS("CXXDependentScopeMemberExpr", "const int found = N");
965982
}
966983

967984
TEST_F(TargetDeclTest, DependentTypes) {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,13 @@ sizeof...($TemplateParameter[[Elements]]);
10921092
$Field_dependentName[[waldo]];
10931093
}
10941094
};
1095+
)cpp",
1096+
// Pointer-to-member with nested-name-specifiers
1097+
R"cpp(
1098+
struct $Class_def[[Outer]] {
1099+
struct $Class_def[[Inner]] {};
1100+
};
1101+
using $Typedef_decl[[Alias]] = void ($Class[[Outer]]::$Class[[Inner]]:: *)();
10951102
)cpp"};
10961103
for (const auto &TestCase : TestCases)
10971104
// Mask off scope modifiers to keep the tests manageable.

clang-tools-extra/test/clang-tidy/checkers/misc/redundant-expression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy %s misc-redundant-expression %t -- -- -fno-delayed-template-parsing
1+
// RUN: %check_clang_tidy %s misc-redundant-expression %t -- -- -fno-delayed-template-parsing -Wno-array-compare-cxx26
22

33
typedef __INT64_TYPE__ I64;
44

clang/docs/LanguageExtensions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ elementwise to the input.
648648
Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±infinity
649649

650650
The integer elementwise intrinsics, including ``__builtin_elementwise_popcount``,
651-
``__builtin_elementwise_bitreverse``, can be called in a ``constexpr`` context.
651+
``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``,
652+
``__builtin_elementwise_sub_sat`` can be called in a ``constexpr`` context.
652653

653654
============================================== ====================================================================== =========================================
654655
Name Operation Supported element types

clang/docs/RealtimeSanitizer.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,19 @@ A **partial** list of flags RealtimeSanitizer respects:
187187
* - ``abort_on_error``
188188
- OS dependent
189189
- boolean
190-
- If true, the tool calls abort() instead of _exit() after printing the error report. On some OSes (OSX, for exmple) this is beneficial because a better stack trace is emitted on crash.
190+
- If true, the tool calls ``abort()`` instead of ``_exit()`` after printing the error report. On some OSes (MacOS, for exmple) this is beneficial because a better stack trace is emitted on crash.
191191
* - ``symbolize``
192192
- ``true``
193193
- boolean
194194
- If set, use the symbolizer to turn virtual addresses to file/line locations. If false, can greatly speed up the error reporting.
195195
* - ``suppressions``
196-
- ""
196+
- ``""``
197197
- path
198-
- If set to a valid suppressions file, will suppress issue reporting. See details in "Disabling", below.
199-
198+
- If set to a valid suppressions file, will suppress issue reporting. See details in `Disabling and Suppressing`_.
199+
* - ``verify_interceptors``
200+
- ``true``
201+
- boolean
202+
- If true, verifies interceptors are working at initialization. The program will abort with error ``==ERROR: Interceptors are not working. This may be because RealtimeSanitizer is loaded too late (e.g. via dlopen)`` if an issue is detected.
200203

201204
Some issues with flags can be debugged using the ``verbosity=$NUM`` flag:
202205

@@ -244,6 +247,7 @@ To register a callback which will be invoked before a RTSan kills the process:
244247
...
245248
}
246249
250+
.. _disabling-and-suppressing:
247251

248252
Disabling and suppressing
249253
-------------------------

clang/docs/ReleaseNotes.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,11 @@ Non-comprehensive list of changes in this release
408408
The flexible array member (FAM) can now be accessed immediately without causing
409409
issues with the sanitizer because the counter is automatically set.
410410

411-
- ``__builtin_reduce_add`` function can now be used in constant expressions.
412-
- ``__builtin_reduce_mul`` function can now be used in constant expressions.
413-
- ``__builtin_reduce_and`` function can now be used in constant expressions.
414-
- ``__builtin_reduce_or`` and ``__builtin_reduce_xor`` functions can now be used in constant expressions.
415-
- ``__builtin_elementwise_popcount`` function can now be used in constant expressions.
416-
- ``__builtin_elementwise_bitreverse`` function can now be used in constant expressions.
411+
- The following builtins can now be used in constant expressions: ``__builtin_reduce_add``,
412+
``__builtin_reduce_mul``, ``__builtin_reduce_and``, ``__builtin_reduce_or``,
413+
``__builtin_reduce_xor``, ``__builtin_elementwise_popcount``,
414+
``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``,
415+
``__builtin_elementwise_sub_sat``.
417416

418417
New Compiler Flags
419418
------------------
@@ -428,6 +427,9 @@ New Compiler Flags
428427
- The ``-Warray-compare`` warning has been added to warn about array comparison
429428
on versions older than C++20.
430429

430+
- The ``-Warray-compare-cxx26`` warning has been added to warn about array comparison
431+
starting from C++26, this warning is enabled as an error by default.
432+
431433
Deprecated Compiler Flags
432434
-------------------------
433435

@@ -525,6 +527,9 @@ Attribute Changes in Clang
525527

526528
- The ``target_version`` attribute is now only supported for AArch64 and RISC-V architectures.
527529

530+
- Clang now permits the usage of the placement new operator in ``[[msvc::constexpr]]``
531+
context outside of the std namespace. (#GH74924)
532+
528533
Improvements to Clang's diagnostics
529534
-----------------------------------
530535

@@ -793,9 +798,11 @@ Bug Fixes to C++ Support
793798
- Fixed a bug where bounds of partially expanded pack indexing expressions were checked too early. (#GH116105)
794799
- Fixed an assertion failure caused by using ``consteval`` in condition in consumed analyses. (#GH117385)
795800
- Fix a crash caused by incorrect argument position in merging deduced template arguments. (#GH113659)
801+
- Fixed a parser crash when using pack indexing as a nested name specifier. (#GH119072)
796802
- Fixed an assertion failure caused by mangled names with invalid identifiers. (#GH112205)
797803
- Fixed an incorrect lambda scope of generic lambdas that caused Clang to crash when computing potential lambda
798804
captures at the end of a full expression. (#GH115931)
805+
- Clang no longer rejects deleting a pointer of incomplete enumeration type. (#GH99278)
799806
- Fixed recognition of ``std::initializer_list`` when it's surrounded with ``extern "C++"`` and exported
800807
out of a module. (#GH118218)
801808

clang/docs/UsersManual.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ is being invoked, and added after all of the command-line specified linker
10661066
inputs. Here is some example of ``$``-prefixed options:
10671067

10681068
::
1069+
10691070
$-Wl,-Bstatic $-lm
10701071
$-Wl,-Bshared
10711072

0 commit comments

Comments
 (0)