Skip to content

Commit a14fb11

Browse files
authored
Merge branch 'main' into process-mrelease
2 parents 0194da2 + 46a0857 commit a14fb11

File tree

704 files changed

+34808
-11499
lines changed

Some content is hidden

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

704 files changed

+34808
-11499
lines changed

bolt/utils/bughunter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ if [[ $FAIL -eq "0" ]]; then
131131
fi
132132
else
133133
echo "Did it pass? Type the return code [0 = pass, 1 = fail]"
134-
read -n1 PASS
134+
read -n1 FAIL
135135
fi
136136
if [[ $FAIL -eq "0" ]] ; then
137137
echo " Warning: optimized binary passes."
@@ -205,7 +205,7 @@ while [[ "$CONTINUE" -ne "0" ]] ; do
205205
echo " OPTIMIZED_BINARY failure=$FAIL"
206206
else
207207
echo "Did it pass? Type the return code [0 = pass, 1 = fail]"
208-
read -n1 PASS
208+
read -n1 FAIL
209209
fi
210210
else
211211
FAIL=1

clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -467,18 +467,9 @@ class DefineOutline : public Tweak {
467467
}
468468
}
469469

470-
// For function templates, the same limitations as for class templates
471-
// apply.
472-
if (const TemplateParameterList *Params =
473-
MD->getDescribedTemplateParams()) {
474-
// FIXME: Is this really needed? It inhibits application on
475-
// e.g. std::enable_if.
476-
for (NamedDecl *P : *Params) {
477-
if (!P->getIdentifier())
478-
return false;
479-
}
470+
// Function templates must be defined in the same file.
471+
if (MD->getDescribedTemplate())
480472
SameFile = true;
481-
}
482473

483474
// The refactoring is meaningless for unnamed classes and namespaces,
484475
// unless we're outlining in the same file

clang-tools-extra/clangd/unittests/tweaks/DefineOutlineTests.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ TEST_F(DefineOutlineTest, TriggersOnFunctionDecl) {
118118
template <> void fo^o<int>() {}
119119
)cpp");
120120

121-
// Not available on member function templates with unnamed template
122-
// parameters.
123-
EXPECT_UNAVAILABLE(R"cpp(
124-
struct Foo { template <typename> void ba^r() {} };
125-
)cpp");
126-
127121
// Not available on methods of unnamed classes.
128122
EXPECT_UNAVAILABLE(R"cpp(
129123
struct Foo {
@@ -410,14 +404,14 @@ inline typename O1<T, U...>::template O2<V, A>::E O1<T, U...>::template O2<V, A>
410404
{
411405
R"cpp(
412406
struct Foo {
413-
template <typename T, bool B = true>
407+
template <typename T, typename, bool B = true>
414408
T ^bar() { return {}; }
415409
};)cpp",
416410
R"cpp(
417411
struct Foo {
418-
template <typename T, bool B = true>
412+
template <typename T, typename, bool B = true>
419413
T bar() ;
420-
};template <typename T, bool B>
414+
};template <typename T, typename, bool B>
421415
inline T Foo::bar() { return {}; }
422416
)cpp",
423417
""},
@@ -426,13 +420,13 @@ inline T Foo::bar() { return {}; }
426420
{
427421
R"cpp(
428422
template <typename T> struct Foo {
429-
template <typename U> T ^bar(const T& t, const U& u) { return {}; }
423+
template <typename U, bool> T ^bar(const T& t, const U& u) { return {}; }
430424
};)cpp",
431425
R"cpp(
432426
template <typename T> struct Foo {
433-
template <typename U> T bar(const T& t, const U& u) ;
427+
template <typename U, bool> T bar(const T& t, const U& u) ;
434428
};template <typename T>
435-
template <typename U>
429+
template <typename U, bool>
436430
inline T Foo<T>::bar(const T& t, const U& u) { return {}; }
437431
)cpp",
438432
""},

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Hover
7373
Code completion
7474
^^^^^^^^^^^^^^^
7575

76+
- Added completion for C++20 keywords.
77+
7678
Code actions
7779
^^^^^^^^^^^^
7880

clang/docs/LanguageExtensions.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ elementwise to the input.
647647

648648
Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±infinity
649649

650+
The integer elementwise intrinsics, including ``__builtin_elementwise_popcount``,
651+
can be called in a ``constexpr`` context.
652+
650653
============================================== ====================================================================== =========================================
651654
Name Operation Supported element types
652655
============================================== ====================================================================== =========================================

clang/docs/OpenMPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ implementation.
290290
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
291291
| memory management | changes to omp_alloctrait_key enum | :none:`unclaimed` | |
292292
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
293-
| memory model | seq_cst clause on flush construct | :none:`unclaimed` | |
293+
| memory model | seq_cst clause on flush construct | :good:`done` | https://github.com/llvm/llvm-project/pull/114072 |
294294
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
295295
| misc | 'omp_all_memory' keyword and use in 'depend' clause | :good:`done` | D125828, D126321 |
296296
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ C23 Feature Support
332332

333333
- Clang now supports `N3029 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3029.htm>`_ Improved Normal Enumerations.
334334
- Clang now officially supports `N3030 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3030.htm>`_ Enhancements to Enumerations. Clang already supported it as an extension, so there were no changes to compiler behavior.
335+
- Fixed the value of ``BOOL_WIDTH`` in ``<limits.h>`` to return ``1``
336+
explicitly, as mandated by the standard. Fixes #GH117348
335337

336338
Non-comprehensive list of changes in this release
337339
-------------------------------------------------
@@ -370,6 +372,7 @@ Non-comprehensive list of changes in this release
370372
- ``__builtin_reduce_mul`` function can now be used in constant expressions.
371373
- ``__builtin_reduce_and`` function can now be used in constant expressions.
372374
- ``__builtin_reduce_or`` and ``__builtin_reduce_xor`` functions can now be used in constant expressions.
375+
- ``__builtin_elementwise_popcount`` function can now be used in constant expressions.
373376

374377
New Compiler Flags
375378
------------------
@@ -471,6 +474,8 @@ Attribute Changes in Clang
471474
- Clang now supports ``[[clang::lifetime_capture_by(X)]]``. Similar to lifetimebound, this can be
472475
used to specify when a reference to a function parameter is captured by another capturing entity ``X``.
473476

477+
- The ``target_version`` attribute is now only supported for AArch64 and RISC-V architectures.
478+
474479
Improvements to Clang's diagnostics
475480
-----------------------------------
476481

@@ -583,6 +588,8 @@ Improvements to Clang's diagnostics
583588
- For an rvalue reference bound to a temporary struct with an integer member, Clang will detect constant integer overflow
584589
in the initializer for the integer member (#GH46755).
585590

591+
- Fixed a false negative ``-Wunused-private-field`` diagnostic when a defaulted comparison operator is defined out of class (#GH116961).
592+
586593
Improvements to Clang's time-trace
587594
----------------------------------
588595

@@ -714,6 +721,7 @@ Bug Fixes to C++ Support
714721
assumption if they also occur inside of a dependent lambda. (#GH114787)
715722
- Clang now uses valid deduced type locations when diagnosing functions with trailing return type
716723
missing placeholder return type. (#GH78694)
724+
- Fixed a bug where bounds of partially expanded pack indexing expressions were checked too early. (#GH116105)
717725

718726
Bug Fixes to AST Handling
719727
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -723,6 +731,8 @@ Bug Fixes to AST Handling
723731
sometimes incorrectly return null even if a comment was present. (#GH108145)
724732
- Clang now correctly parses the argument of the ``relates``, ``related``, ``relatesalso``,
725733
and ``relatedalso`` comment commands.
734+
- Clang now uses the location of the begin of the member expression for ``CallExpr``
735+
involving deduced ``this``. (#GH116928)
726736

727737
Miscellaneous Bug Fixes
728738
^^^^^^^^^^^^^^^^^^^^^^^

clang/docs/SanitizerCoverage.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,20 @@ Users need to implement a single function to capture the CF table at startup:
385385
// the collected control flow.
386386
}
387387
388+
Gated Trace Callbacks
389+
=====================
390+
391+
Gate the invocation of the tracing callbacks with
392+
``-sanitizer-coverage-gated-trace-callbacks``.
393+
394+
When this option is enabled, the instrumentation will not call into the
395+
runtime-provided callbacks for tracing, thus only incurring in a trivial
396+
branch without going through a function call.
397+
398+
It is up to the runtime to toggle the value of the global variable in order to
399+
enable tracing.
400+
401+
This option is only supported for trace-pc-guard and trace-cmp.
388402

389403
Disabling instrumentation with ``__attribute__((no_sanitize("coverage")))``
390404
===========================================================================

clang/include/clang/AST/ExprCXX.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4390,17 +4390,17 @@ class PackIndexingExpr final
43904390
unsigned TransformedExpressions : 31;
43914391

43924392
LLVM_PREFERRED_TYPE(bool)
4393-
unsigned ExpandedToEmptyPack : 1;
4393+
unsigned FullySubstituted : 1;
43944394

43954395
PackIndexingExpr(QualType Type, SourceLocation EllipsisLoc,
43964396
SourceLocation RSquareLoc, Expr *PackIdExpr, Expr *IndexExpr,
43974397
ArrayRef<Expr *> SubstitutedExprs = {},
4398-
bool ExpandedToEmptyPack = false)
4398+
bool FullySubstituted = false)
43994399
: Expr(PackIndexingExprClass, Type, VK_LValue, OK_Ordinary),
44004400
EllipsisLoc(EllipsisLoc), RSquareLoc(RSquareLoc),
44014401
SubExprs{PackIdExpr, IndexExpr},
44024402
TransformedExpressions(SubstitutedExprs.size()),
4403-
ExpandedToEmptyPack(ExpandedToEmptyPack) {
4403+
FullySubstituted(FullySubstituted) {
44044404

44054405
auto *Exprs = getTrailingObjects<Expr *>();
44064406
std::uninitialized_copy(SubstitutedExprs.begin(), SubstitutedExprs.end(),
@@ -4424,12 +4424,16 @@ class PackIndexingExpr final
44244424
SourceLocation RSquareLoc, Expr *PackIdExpr,
44254425
Expr *IndexExpr, std::optional<int64_t> Index,
44264426
ArrayRef<Expr *> SubstitutedExprs = {},
4427-
bool ExpandedToEmptyPack = false);
4427+
bool FullySubstituted = false);
44284428
static PackIndexingExpr *CreateDeserialized(ASTContext &Context,
44294429
unsigned NumTransformedExprs);
44304430

4431+
bool isFullySubstituted() const { return FullySubstituted; }
4432+
44314433
/// Determine if the expression was expanded to empty.
4432-
bool expandsToEmptyPack() const { return ExpandedToEmptyPack; }
4434+
bool expandsToEmptyPack() const {
4435+
return isFullySubstituted() && TransformedExpressions == 0;
4436+
}
44334437

44344438
/// Determine the location of the 'sizeof' keyword.
44354439
SourceLocation getEllipsisLoc() const { return EllipsisLoc; }

clang/include/clang/AST/OpenMPClause.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,8 +2670,8 @@ class OMPCompareClause final : public OMPClause {
26702670
}
26712671
};
26722672

2673-
/// This represents 'seq_cst' clause in the '#pragma omp atomic'
2674-
/// directive.
2673+
/// This represents 'seq_cst' clause in the '#pragma omp atomic|flush'
2674+
/// directives.
26752675
///
26762676
/// \code
26772677
/// #pragma omp atomic seq_cst

0 commit comments

Comments
 (0)