631 Commits

Author SHA1 Message Date
Ashwin Kishin Banwari
1830b87090
[NFC] [C++] [Modules] Mark P2115 as implemented and add test (#147489)
This is already implemented. Proposal:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2115r0.html
2025-07-08 18:36:53 +08:00
Ashwin Kishin Banwari
48ff068c52
[NFC] [C++] [Modules] Mark P2788 as implemented and add test (#147138)
This is already implemented.
2025-07-08 10:01:08 +08:00
Ashwin Kishin Banwari
e427bd55a8
[NFC] [C++] [Modules] Mark P2615 as implemented and add test (#147135)
This is already implemented. See godbolt:
https://godbolt.org/z/1ra4Ka8od
2025-07-08 10:00:55 +08:00
Ashwin Kishin Banwari
84be78524d
[NFC] [C++] [Modules] Mark P1811 as implemented and add test (#146993)
This is already implemented. See godbolt:
https://godbolt.org/z/7x3arqj3G
2025-07-08 09:54:33 +08:00
Ashwin Kishin Banwari
ca0b56639c
[NFC] [C++] [Modules] Mark P1979 as implemented and add test (#146841)
Proposal
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1979r0.html
appears to already be implemented as of Clang17. See:
https://godbolt.org/z/h59Mvzq6P
2025-07-03 19:03:39 +08:00
Ashwin Banwari
2599a9aeb5
[clang] [modules] Implement P3618R0: Allow attaching main to the global module (#146461)
Remove the prior warning for attaching extern "C++" to main.
2025-07-02 09:52:10 +08:00
Corentin Jabot
c69f97cb95 [Clang] Add WG21 papers from the Sofia meeting to the status page 2025-06-21 11:17:19 +03:00
cor3ntin
300d4026f7
[Clang] Implement the core language parts of P2786 - Trivial relocation (#127636)
This adds

- The parsing of `trivially_relocatable_if_eligible`,
`replaceable_if_eligible` keywords
- `__builtin_trivially_relocate`, implemented in terms of memmove. In
the future this should
- Add the appropriate start/end lifetime markers that llvm does not have
(`start_lifetime_as`)
     - Add support for ptrauth when that's upstreamed

- the `__builtin_is_cpp_trivially_relocatable` and
`__builtin_is_replaceable` traits


Fixes #127609
2025-05-06 14:13:32 +02:00
Younan Zhang
f4218753ad
[Clang] Implement P0963R3 "Structured binding declaration as a condition" (#130228)
This implements the R2 semantics of P0963.

The R1 semantics, as outlined in the paper, were introduced in Clang 6.
In addition to that, the paper proposes swapping the evaluation order of
condition expressions and the initialization of binding declarations
(i.e. std::tuple-like decompositions).
2025-03-11 15:41:56 +08:00
Aaron Ballman
9a0e652ec7 [www] Update the C++ status pages for Clang 20 2025-03-06 16:06:51 -05:00
cor3ntin
43ec9e1893
[Clang] Mark that P2280R4 was approved as a dr in the status page 2025-03-04 12:56:42 +01:00
cor3ntin
12f8ed58a0
[Clang] Mark P1061 (Structured Bindings can introduce a Pack) as implemented (#127980)
Implemented in abc8812df02599fc413d9ed77b992f8236ed2af9
2025-02-20 13:55:32 +01:00
Corentin Jabot
8f3a070db9 [Clang] Add new WG21 papers(Hagenberg) papers to the C++ status page 2025-02-15 10:54:14 +01:00
Matheus Izvekov
8a334af417
[clang] Remove the deprecated flag -frelaxed-template-template-args. (#111894)
This flag has been deprecated since Clang 19, having been the default
since then.

It has remained because its negation was still useful to work around
backwards compatibility breaking changes from P0522.

However, in Clang 20 we have landed various changes which implemented
P3310R2 and beyond, which solve almost all of the expected issues, the
known remaining few being a bit obscure.

So this change removes the flag completely and all of its implementation
and support code.

Hopefully any remaining users can just stop using the flag. If there are
still important issues remaining, this removal will also shake the tree
and help us know.
2025-01-29 16:57:05 -03:00
cor3ntin
0369ac8d25
Fix markup in cxx_status.html 2025-01-22 09:31:54 +01:00
Shafik Yaghmour
0a9c08c59b
[Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (#95474)
P2280R4 allows the use of references in pointers of unknown origins in a
constant expression context but only in specific cases that could be
constant expressions.

We track whether a variable is a constexpr unknown in a constant
expression by setting a flag in either APValue or LValue and using this
flag to prevent using unknown values in places where it is not allowed.

Fixes: https://github.com/llvm/llvm-project/issues/63139 https://github.com/llvm/llvm-project/issues/63117
2025-01-22 09:28:08 +01:00
Amr Hesham
3f458cd9ab
[Clang] Warning as error Array Comparisons from C++26 (#118872)
Starting from C++26 the array comparison warning should converted to an
error.

Fixes: #117859
2024-12-07 18:28:09 +01:00
antangelo
54fcf3ec26
[clang] Implement P3176R1: The Oxford variadic comma (#117524)
Emit a deprecation warning when a variadic parameter in a
parameter-declaration-clause is not preceded by a comma for C++26.
2024-12-02 03:53:55 -05:00
Corentin Jabot
3a31427224 [Clang] Add C++26 approved in the Poland WG21 meeting 2024-11-23 10:05:48 +01:00
yronglin
25d9688c43
[Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (#86960)
Depends on [CWG1815](https://github.com/llvm/llvm-project/pull/108039).
Fixes https://github.com/llvm/llvm-project/issues/85613.

In [[Clang] Implement P2718R0 "Lifetime extension in range-based for
loops"](https://github.com/llvm/llvm-project/pull/76361), we've not
implement the lifetime extensions for the temporaries which in
`CXXDefaultInitExpr`. As the confirmation in
https://github.com/llvm/llvm-project/issues/85613, we should extend
lifetime for that.

To avoid modifying current CodeGen rules, in a lifetime extension
context, the cleanup of `CXXDefaultInitExpr` was ignored.

---------

Signed-off-by: yronglin <yronglin777@gmail.com>
2024-10-11 00:04:02 +08:00
cor3ntin
49a754a43d
[Clang] Mark Clang 19 language changes as being released [NFC] (#108978) 2024-09-17 16:02:43 +02:00
cor3ntin
6e78aef646
[Clang] Implement P2747 constexpr placement new (#104586)
The implementation follows the resolution of CWG2922
2024-08-23 17:24:08 +02:00
Sirraide
2b0a8fcf70
[Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (#101448)
Implement P2893R3 ‘Variadic friends’ for C++26.

This closes #98587.

Co-authored-by: Younan Zhang <zyn7109@gmail.com>
2024-08-15 21:16:30 +02:00
yronglin
c91e85278c
Revert "[Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros" (#99838)
Reverts llvm/llvm-project#90574
2024-07-22 13:16:51 +08:00
yronglin
e77a01d79a
[Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (#90574)
This PR implement [P3034R1 Module Declarations Shouldn’t be
Macros](https://wg21.link/P3034R1), and refactor the convoluted state
machines in module name lexical analysis.

---------

Signed-off-by: yronglin <yronglin777@gmail.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
2024-07-20 20:41:00 +08:00
cor3ntin
b330d800cb
Reapply [Clang][C++26] Implement "Ordering of constraints involving fold expressions (#99022)
Implement https://isocpp.org/files/papers/P2963R3.pdf
2024-07-17 07:52:40 +02:00
cor3ntin
762a47828e
Revert "[Clang][C++26] Implement "Ordering of constraints involving fold expressions" (#99007)
Reverts llvm/llvm-project#98160

Breaks CI on some architectures
2024-07-16 11:00:27 +02:00
cor3ntin
2448927359
[Clang][C++26] Implement "Ordering of constraints involving fold expressions (#98160)
Implement https://isocpp.org/files/papers/P2963R3.pdf
2024-07-16 10:39:06 +02:00
cor3ntin
e55585fd7b
[Clang] Fix typo in cxx_status.html 2024-07-06 16:18:20 +02:00
Vlad Serebrennikov
788731cdbd
[clang] Implement P3144R2 "Deleting a Pointer to an Incomplete Type..." (#97733)
This patch implements (not yet published)
[P3144R2](https://wiki.edg.com/pub/Wg21stlouis2024/StrawPolls/p3144r2.pdf)
"Deleting a Pointer to an Incomplete Type Should be Ill-formed". Wording
changes (not yet merged into the working draft) read:
> 7.6.2.9 [expr.delete] Delete
> If the object being deleted has incomplete class type at the point of
deletion <del>and the complete class has a
non-trivial destructor or a deallocation function, the behavior is
undefined</del>, <ins>the program is ill-formed</ins>.

We preserve status quo of emitting a warning when deleting a pointer to
incomplete type up to, and including, C++23, but make it ill-formed
since C++26. Same goes for deleting pointers to `void`, which has been
allowed as an extension.
2024-07-05 22:27:04 +04:00
Aaron Ballman
aa3c84c85c Clang 19 isn't yet released; NFC
...just updates the colors in the table.
2024-07-03 10:36:12 -04:00
Corentin Jabot
101a936bde [Clang] dd the papers adopted in St Louis to the status page 2024-06-29 09:23:41 -05:00
A. Jiang
2151ba0362
[Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (#68846)
List the following C++23-era WG21 papers as Defect Reports in
cxx_status.html as per WG21 meeting minutes.

- [P1949R7](https://wg21.link/p1949r7) (C++ Identifier Syntax using
Unicode Standard Annex 31)
 - [P2156R1](https://wg21.link/p2156r1) (Allow Duplicate Attributes)
- [P2036R3](https://wg21.link/p2036r3) (Change scope of lambda
_trailing-return-type_)
- [P2468R2](https://wg21.link/p2468r2) (The Equality Operator You Are
Looking For)
- [P2327R1](https://wg21.link/p2327r1) (De-deprecating `volatile`
compound operations)
- [P2493R0](https://wg21.link/p2493r0) (Missing feature test macros for
C++20 core papers)
- [P2513R3](https://wg21.link/p2513r3) (`char8_t` Compatibility and
Portability Fix)
- [P2460R2](https://wg21.link/p2460r2) (Relax requirements on `wchar_t`
to match existing practices)
- [P2579R0](https://wg21.link/p2579r0) (Mitigation strategies for
[P2036](https://wg21.link/p2036) ”Changing scope for lambda
_trailing-return-type_”)
2024-06-24 13:16:47 +04:00
cor3ntin
d0223b9ffc
[Clang] Static and explicit object member functions with the same parameter-type-lists (#93430)
Implement P2797.

Because taking the address of an explicit object member function results
in a function pointer, a call expression where the id-expression is an
explicit object member is made to behave consistently with that model.

This change forces clang to perform overload resolution in the presence
of an id-expression of the form `(&Foo::bar)(args...)`, which we
previously failed to do consistently.
2024-06-05 16:50:42 +02:00
Pengcheng Wang
130e93cc26
Reland "[clang] Enable sized deallocation by default in C++14 onwards" (#90373)
Since C++14 has been released for about nine years and most standard
libraries have implemented sized deallocation functions, it's time to
make this feature default again.

This is another try of https://reviews.llvm.org/D112921.

The original commit cf5a8b4 was reverted by 2e5035a due to some
failures (see #83774).

Fixes #60061
2024-05-22 12:37:27 +08:00
Vlad Serebrennikov
d1f96d4cfe [clang][NFC] Claim support for P3106R1 since Clang 17
Test for this paper were added in https://github.com/llvm/llvm-project/pull/91435
2024-05-16 17:53:14 +03:00
Haojian Wu
a9605730a4
[clang] CTAD: implement the missing IsDeducible constraint for alias templates (#89358)
Fixes https://github.com/llvm/llvm-project/issues/85192
Fixes https://github.com/llvm/llvm-project/issues/84492

This patch implements the "IsDeducible" constraint where the template
arguments of the alias template can be deduced from the returned type of
the synthesized deduction guide, per C++ [over.match.class.deduct]p4. In
the implementation, we perform the deduction directly, which is more
efficient than the way specified in the standard.

Also update relevant CTAD tests which were incorrectly compiled due to
the missing constraint.
2024-05-16 13:01:18 +02:00
cor3ntin
cff9e77783
[Clang][NFC] Mark P2552 as implemented. (#92007)
wg21.link/P2552 suggest that __has_cpp_attribute
should return a non-zero value for all attributes that the
implementation does something interesting with.

Clang does something meaninful with all attributes except for:

- no_unique_address which we do not support for msvc target
- carries_dependency which arguably does nothing interesting. P2552
shies away from specifying a behavior for that attribute (despite being
the only one for which a recommandation would have been interesting,
arguably)

As such, we have nothing to change for this paper. This paper is a DR
and clang always behaved reasonably.
2024-05-14 06:15:01 +02:00
cor3ntin
2dbe89d150
[Clang] Implement __reference_converts_from_temporary (#91199)
This completes the required language support for P2255R2.
2024-05-10 08:50:44 +02:00
cor3ntin
642117105d
[Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (#90066)
https://wg21.link/P2809R3

This is applied as a DR to C++11 (C++98 did not guarantee forward
progress and is left untouched)

As an extension (and to preserve existing behavior in C), we consider
all controlling expression that can be constant folded
in the front end, not just standard constant expressions.
2024-05-03 14:10:54 +02:00
Matheus Izvekov
62c29593be
[clang] NFC: cxx_status mark P0522R0 as unreleased
Addressing post-commit review on #89807
2024-05-02 13:55:33 -03:00
Matheus Izvekov
b86e0992bf
[clang] Enable C++17 relaxed template template argument matching by default (#89807)
This patch will finally allow us to mark C++17 support in clang as
complete.
    
In order to implement this as a DR and avoid breaking reasonable code
that worked before P0522, this patch implements a provisional resolution
for CWG2398: When deducing template template parameters against each other,
and the argument side names a template specialization, instead of just
deducing A, we deduce a synthesized template template parameter based
on A, but with it's parameters using the template specialization's arguments
as defaults.
    
The driver flag is deprecated with a warning.
    
Fixes https://github.com/llvm/llvm-project/issues/36505
2024-05-02 02:02:35 -03:00
cor3ntin
6992433434
[Clang][NFC] Fix status colors 2024-04-30 23:05:47 +02:00
yronglin
6fab3f2a2b
[NFC][Clang] Update P2718R0 implementation status to partial supported (#90577)
Once https://github.com/llvm/llvm-project/issues/85613 fixed, we can
mark this feature fully supported.

Signed-off-by: yronglin <yronglin777@gmail.com>
2024-04-30 18:58:59 +08:00
cor3ntin
326657f567
[Clang] Address post commit feedbacks in #89906 (#90495)
* Fix a leak
* Fix a maybe unused warning
* Fix incorrect cxx_status entry
2024-04-29 22:11:09 +02:00
yronglin
e71840305d
[Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (#89942)
Implement P2748R5 "Disallow Binding a Returned Glvalue to a Temporary"
https://wg21.link/P2748R5

---------

Signed-off-by: yronglin <yronglin777@gmail.com>
2024-04-29 22:00:10 +08:00
cor3ntin
6dd90616c4
[Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (#89906)
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0609r3.pdf

We support this feature in all language mode.

maybe_unused applied to a binding makes the whole declaration unused.
2024-04-28 20:25:44 +02:00
Vitaly Buka
2e5035aeed
Revert "[clang] Enable sized deallocation by default in C++14 onwards (#83774)" (#90299)
https://lab.llvm.org/buildbot/#/builders/168/builds/20063 (should be
fixed with #90292)

More details in #83774

This reverts commit cf5a8b489464d09dfdd7a48ce7c8b41d3c9bf819.
2024-04-26 17:14:43 -07:00
Pengcheng Wang
cf5a8b4894
[clang] Enable sized deallocation by default in C++14 onwards (#83774)
Since C++14 has been released for about nine years and most standard
libraries have implemented sized deallocation functions, it's time to
make this feature default again.

This is another try of https://reviews.llvm.org/D112921.

Fixes #60061
2024-04-26 16:59:12 +08:00
Sirraide
ef164cee90
[Clang] [C++26] Implement P2573R2: = delete("should have a reason"); (#86526)
This implements support for the `= delete("message")` syntax that was
only just added to C++26
([P2573R2](https://isocpp.org/files/papers/P2573R2.html#proposal-scope)).
2024-04-14 12:30:01 +02:00