Skip to content

Commit a111502

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents bd233df + 6181f4f commit a111502

File tree

561 files changed

+23957
-6302
lines changed

Some content is hidden

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

561 files changed

+23957
-6302
lines changed

clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ static const clang::StringRef GlibcFunctions[] = {
153153
"::sigsuspend",
154154
"::sleep",
155155
"::srand48",
156-
"::strerror",
157156
"::strsignal",
158157
"::strtok",
159158
"::tcflow",

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ Changes in existing checks
172172
<clang-tidy/checks/cert/err33-c>` check by fixing false positives when
173173
a function name is just prefixed with a targeted function name.
174174

175+
- Improved :doc:`concurrency-mt-unsafe
176+
<clang-tidy/checks/concurrency/mt-unsafe>` check by fixing a false positive
177+
where ``strerror`` was flagged as MT-unsafe.
178+
175179
- Improved :doc:`misc-const-correctness
176180
<clang-tidy/checks/misc/const-correctness>` check by adding the option
177181
`AllowedTypes`, that excludes specified types from const-correctness

clang-tools-extra/test/clang-tidy/checkers/concurrency/mt-unsafe-glibc.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
extern unsigned int sleep (unsigned int __seconds);
44
extern int *gmtime (const int *__timer);
55
extern char *dirname (char *__path);
6+
extern char *strerror(int errnum);
67

78
void foo() {
89
sleep(2);
@@ -12,4 +13,6 @@ void foo() {
1213
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: function is not thread safe [concurrency-mt-unsafe]
1314

1415
dirname(nullptr);
16+
17+
strerror(0);
1518
}

clang/bindings/python/clang/cindex.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,8 @@ class Cursor(Structure):
15851585
"""
15861586
The Cursor class represents a reference to an element within the AST. It
15871587
acts as a kind of iterator.
1588+
1589+
Null cursors are mapped to None.
15881590
"""
15891591

15901592
_fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)]

clang/docs/BoundsSafety.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ In C, arrays on function prototypes are promoted (or "decayed") to a pointer to
664664
its first element (e.g., ``&arr[0]``). In ``-fbounds-safety``, arrays are also
665665
decayed to pointers, but with the addition of an implicit bounds annotation,
666666
which includes variable-length arrays (VLAs). As shown in the following example,
667-
arrays on function prototypes are decalyed to corresponding ``__counted_by``
667+
arrays on function prototypes are decayed to corresponding ``__counted_by``
668668
pointers.
669669

670670
.. code-block:: c

clang/docs/BoundsSafetyAdoptionGuide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Annotate pointers on struct fields and function parameters if they are pointing
3939
to an array of object, with appropriate bounds annotations. Please see
4040
:doc:`BoundsSafety` to learn what kind of bounds annotations are available and
4141
their semantics. Note that local pointer variables typically don't need bounds
42-
annotations because they are implicitely a wide pointer (``__bidi_indexable``)
42+
annotations because they are implicitly a wide pointer (``__bidi_indexable``)
4343
that automatically carries the bounds information.
4444

4545
Address compiler diagnostics

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5990,41 +5990,25 @@ the configuration (without a prefix: ``Auto``).
59905990
**SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8` :ref:`<SortIncludes>`
59915991
Controls if and how clang-format will sort ``#includes``.
59925992

5993-
Possible values:
5994-
5995-
* ``SI_Never`` (in configuration: ``Never``)
5996-
Includes are never sorted.
5997-
5998-
.. code-block:: c++
5999-
6000-
#include "B/A.h"
6001-
#include "A/B.h"
6002-
#include "a/b.h"
6003-
#include "A/b.h"
6004-
#include "B/a.h"
6005-
6006-
* ``SI_CaseSensitive`` (in configuration: ``CaseSensitive``)
6007-
Includes are sorted in an ASCIIbetical or case sensitive fashion.
5993+
Nested configuration flags:
60085994

6009-
.. code-block:: c++
5995+
Includes sorting options.
60105996

6011-
#include "A/B.h"
6012-
#include "A/b.h"
6013-
#include "B/A.h"
6014-
#include "B/a.h"
6015-
#include "a/b.h"
5997+
* ``bool Enabled`` If ``true``, includes are sorted based on the other suboptions below.
5998+
(``Never`` is deprecated by ``Enabled: false``.)
60165999

6017-
* ``SI_CaseInsensitive`` (in configuration: ``CaseInsensitive``)
6018-
Includes are sorted in an alphabetical or case insensitive fashion.
6000+
* ``bool IgnoreCase`` Whether or not includes are sorted in a case-insensitive fashion.
6001+
(``CaseSensitive`` and ``CaseInsensitive`` are deprecated by
6002+
``IgnoreCase: false`` and ``IgnoreCase: true``, respectively.)
60196003

60206004
.. code-block:: c++
60216005

6022-
#include "A/B.h"
6023-
#include "A/b.h"
6024-
#include "a/b.h"
6025-
#include "B/A.h"
6026-
#include "B/a.h"
6027-
6006+
true: false:
6007+
#include "A/B.h" vs. #include "A/B.h"
6008+
#include "A/b.h" #include "A/b.h"
6009+
#include "a/b.h" #include "B/A.h"
6010+
#include "B/A.h" #include "B/a.h"
6011+
#include "B/a.h" #include "a/b.h"
60286012

60296013

60306014
.. _SortJavaStaticImport:

clang/docs/HIPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ In other scenarios, calling virtual functions is not allowed.
259259
Explanation
260260
-----------
261261

262-
An object constructed on the device side contains a pointer to the virtual function table on the device side, which is not accessible in host code, and vice versa. Thus, trying to invoke virtual functions from a context different from where the object was constructed will be disallowed because the appropriate virtual table cannot be accessed. The virtual function tables for offloading devices with different architecures are different, therefore trying to invoke virtual functions from an offloading device with a different architecture than where the object is constructed is also disallowed.
262+
An object constructed on the device side contains a pointer to the virtual function table on the device side, which is not accessible in host code, and vice versa. Thus, trying to invoke virtual functions from a context different from where the object was constructed will be disallowed because the appropriate virtual table cannot be accessed. The virtual function tables for offloading devices with different architectures are different, therefore trying to invoke virtual functions from an offloading device with a different architecture than where the object is constructed is also disallowed.
263263

264264
Example Usage
265265
-------------

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ Improvements to Clang's diagnostics
558558
between different Unicode character types (``char8_t``, ``char16_t``, ``char32_t``).
559559
This warning only triggers in C++ as these types are aliases in C. (#GH138526)
560560

561+
- Fixed a crash when checking a ``__thread``-specified variable declaration
562+
with a dependent type in C++. (#GH140509)
563+
561564
Improvements to Clang's time-trace
562565
----------------------------------
563566

@@ -644,7 +647,7 @@ Bug Fixes to Compiler Builtins
644647
- ``__is_trivially_relocatable`` has been deprecated, and uses should be replaced by
645648
``__builtin_is_cpp_trivially_relocatable``.
646649
Note that, it is generally unsafe to ``memcpy`` non-trivially copyable types that
647-
are ``__builtin_is_cpp_trivially_relocatable``. It is recommanded to use
650+
are ``__builtin_is_cpp_trivially_relocatable``. It is recommended to use
648651
``__builtin_trivially_relocate`` instead.
649652

650653
Bug Fixes to Attribute Support
@@ -700,7 +703,7 @@ Bug Fixes to C++ Support
700703
- Fix crash when evaluating the trailing requires clause of generic lambdas which are part of
701704
a pack expansion.
702705
- Fixes matching of nested template template parameters. (#GH130362)
703-
- Correctly diagnoses template template paramters which have a pack parameter
706+
- Correctly diagnoses template template parameters which have a pack parameter
704707
not in the last position.
705708
- Disallow overloading on struct vs class on dependent types, which is IFNDR, as
706709
this makes the problem diagnosable.
@@ -709,7 +712,7 @@ Bug Fixes to C++ Support
709712
- Clang now correctly parses ``if constexpr`` expressions in immediate function context. (#GH123524)
710713
- Fixed an assertion failure affecting code that uses C++23 "deducing this". (#GH130272)
711714
- Clang now properly instantiates destructors for initialized members within non-delegating constructors. (#GH93251)
712-
- Correctly diagnoses if unresolved using declarations shadows template paramters (#GH129411)
715+
- Correctly diagnoses if unresolved using declarations shadows template parameters (#GH129411)
713716
- Fixed C++20 aggregate initialization rules being incorrectly applied in certain contexts. (#GH131320)
714717
- Clang was previously coalescing volatile writes to members of volatile base class subobjects.
715718
The issue has been addressed by propagating qualifiers during derived-to-base conversions in the AST. (#GH127824)
@@ -738,9 +741,11 @@ Bug Fixes to C++ Support
738741
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
739742
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
740743
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
741-
- Fixed a function declaration mismatch that caused inconsistencies between concepts and variable template declarations. (#GH139476)
742744
- Clang no longer segfaults when there is a configuration mismatch between modules and their users (http://crbug.com/400353616).
743745
- Fix an incorrect deduction when calling an explicit object member function template through an overload set address.
746+
- Fixed bug in constant evaluation that would allow using the value of a
747+
reference in its own initializer in C++23 mode (#GH131330).
748+
- Clang could incorrectly instantiate functions in discarded contexts (#GH140449)
744749

745750
Bug Fixes to AST Handling
746751
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -815,7 +820,7 @@ Windows Support
815820
which makes ``offsetof`` provided by Microsoft's ``<stddef.h>`` to be defined
816821
correctly. (#GH59689)
817822

818-
- Clang now can process the `i128` and `ui128` integeral suffixes when MSVC
823+
- Clang now can process the `i128` and `ui128` integral suffixes when MSVC
819824
extensions are enabled. This allows for properly processing ``intsafe.h`` in
820825
the Windows SDK.
821826

clang/docs/UsersManual.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3650,7 +3650,7 @@ below. If multiple flags are present, the last one is used.
36503650
By default, Clang does not emit type information for types that are defined
36513651
but not used in a program. To retain the debug info for these unused types,
36523652
the negation **-fno-eliminate-unused-debug-types** can be used.
3653-
This can be particulary useful on Windows, when using NATVIS files that
3653+
This can be particularly useful on Windows, when using NATVIS files that
36543654
can reference const symbols that would otherwise be stripped, even in full
36553655
debug or standalone debug modes.
36563656

@@ -4267,7 +4267,7 @@ nosvm
42674267
^^^^^
42684268

42694269
Clang supports this attribute to comply to OpenCL v2.0 conformance, but it
4270-
does not have any effect on the IR. For more details reffer to the specification
4270+
does not have any effect on the IR. For more details refer to the specification
42714271
`section 6.7.2
42724272
<https://www.khronos.org/registry/cl/specs/opencl-2.0-openclc.pdf#49>`_
42734273

0 commit comments

Comments
 (0)