Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First batch post March 7th [Nr 0] #237

Merged
merged 173 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
7c63431
[mlir][EmitC] Introduce a `CExpression` trait (#84177)
marbre Mar 7, 2024
7524ad9
[AArch64][GlobalISel] Fix incorrect selection of monotonic s32->s64 a…
aemerson Mar 7, 2024
7a0e222
Revert "Convert many LivePhysRegs uses to LiveRegUnits (#83905)"
jayfoad Mar 7, 2024
91808c8
[docs] Change SPIR-V backend meeting day (#84286)
michalpaszkowski Mar 7, 2024
99500e8
[Clang][C++23] Implement P2448R2: Relaxing some constexpr restriction…
Fznamznon Mar 7, 2024
c59129a
[RISCV] Recursively split concat_vector into smaller LMULs (#83035)
lukel97 Mar 7, 2024
7ce1cfe
[alpha.webkit.UncountedLocalVarsChecker] Allow uncounted object refer…
rniwa Mar 7, 2024
a6382de
AMDGPU: Refactor mfma hazard handling [NFC] (#84276)
arsenm Mar 7, 2024
812c22b
[RemoveDIs][wasm] Apply current debug mode to new function protos (#8…
OCHyams Mar 7, 2024
503c55e
[AArch64] Move SLS later in pass pipeline (#84210)
ostannard Mar 7, 2024
6e79f77
[dataflow][nfc] Fix u8 string usage with c++20 (#84291)
thevinster Mar 7, 2024
84f483d
[libc] Remove UB specializations of type traits for `BigInt` (#84035)
gchatelet Mar 7, 2024
27844cb
Revert "[libc] Remove UB specializations of type traits for `BigInt`"…
gchatelet Mar 7, 2024
bf7f62a
[AMDGPU] Make use of Mnem_gfx11_gfx12. NFC.
jayfoad Mar 7, 2024
469c5e3
[AMDGPU] Simplify definition of renamed DS instructions. NFC.
jayfoad Mar 7, 2024
afac64c
[MLIR] BufferResultsToOutParams: Allow to configure memCpyFn
mgehre-amd Feb 29, 2024
6f54a54
[FMV] Remove duplicate features from mangled name. (#84165)
labrinea Mar 7, 2024
c40146c
[mlir][EmitC] Add Arith to EmitC conversions (#84151)
marbre Mar 7, 2024
245d669
[reland][libc] Remove UB specializations of type traits for `BigInt` …
gchatelet Mar 7, 2024
55304d0
[CostModel] getInstructionCost - improve estimation of costs for leng…
RKSimon Mar 7, 2024
5830d1a
Revert "[dataflow][nfc] Fix u8 string usage with c++20" (#84301)
martinboehme Mar 7, 2024
4119042
[AMDGPU] Simplify EXP Real instruction definitions. NFC.
jayfoad Mar 7, 2024
937a539
[libc++] Remove unused includes from __type_traits/is_convertible.h (…
philnik777 Mar 7, 2024
0086cc9
[AMDGPU] Rename getNumVGPRBlocks. NFC (#84161)
rovka Mar 7, 2024
a11ab13
[clang][dataflow] Fix u8 string error with C++20. (#84302)
martinboehme Mar 7, 2024
d5aecf0
[clang][nullability] Don't discard expression state before end of ful…
martinboehme Mar 7, 2024
59e405b
[flang][OpenMP] Add `%flang_fc1` `RUN` to delayed privatization tests…
ergawy Mar 7, 2024
464d9d9
[RemoveDIs][DebugInfo][IR] Add parsing for non-intrinsic debug values…
SLTozer Mar 7, 2024
4b70d17
[clang-repl] Names declared in if conditions and for-init statements …
weliveindetail Mar 7, 2024
2acccf6
[Clang] Update value for __cpp_implicit_move (#84216) (#84228)
aniplcc Mar 7, 2024
c669c03
[TTI] SK_ExtractSubvector - Ensure we use the src / subvector types i…
RKSimon Mar 7, 2024
48dd118
[Clang] Fix approved revision of P2266
cor3ntin Mar 7, 2024
597be90
[Clang][NFC] Remove '--' separator in the linker wrapper usage (#84253)
jhuber6 Mar 7, 2024
4cfd4a7
[LAA] Add test case for #82665.
fhahn Mar 7, 2024
61b13e0
[ClangOffloadBundler] fix unbundling archive (#84195)
yxsamliu Mar 7, 2024
e4d4cfa
[libc++] Fixes time formatter test output for Linux on PowerPC (#75526)
lei137 Mar 7, 2024
f355cd6
[mlir][EmitC] Allow further ops within expressions (#84284)
marbre Mar 7, 2024
043a020
[libc] Fix missing standard definitions in the GPU config
jhuber6 Mar 7, 2024
2b8aaef
[GISEL] Add IRTranslation for shufflevector on scalable vector types …
michaelmaitland Mar 7, 2024
3239b4d
[lldb][test] Enforce `pexpect` system availability by default (#84270)
rupprecht Mar 7, 2024
03588a2
[lldb][test][FreeBSD] xfail TestPlatformConnect on AArch64
DavidSpickett Mar 7, 2024
9e0f590
[DAG] Fix Failure to reassociate SMAX/SMIN/UMAX/UMIN (#82175)
SahilPatidar Mar 7, 2024
552da24
Revert "[GISEL] Add IRTranslation for shufflevector on scalable vecto…
michaelmaitland Mar 7, 2024
4ce52e2
[SLP]Improve minbitwidth analysis.
alexey-bataev Mar 7, 2024
a213df5
[LinkerWrapper] Use the correct empty file on Windows (#84322)
jhuber6 Mar 7, 2024
d6b3be3
[NFC][Asan] Prepare AddressSanitizer to detect inserted runtime calls…
sylvain-audi Mar 7, 2024
8aed911
[clang][Interp] Implement complex comparisons
tbaederr Mar 7, 2024
5d59fa9
Reapply "[mlir][py] better support for arith.constant construction" (…
ftynse Mar 7, 2024
c03fd37
[flang] Changes to map variables in link clause of declare target (#…
anchuraj Mar 7, 2024
904a6ae
[SLP][NFC]Add lshr version of the test with casting, NFC.
alexey-bataev Mar 7, 2024
101a13d
[libc][stdbit] implement stdc_bit_floor (C23) (#84233)
nickdesaulniers Mar 7, 2024
b1f2e19
[clang][Interp][NFC] Use ArrayElem{,Pop} ops more often
tbaederr Mar 7, 2024
5c752df
[libomptarget][nextgen-plugin][NFC] Clean-up InputSignal checks (#83458)
doru1004 Mar 7, 2024
d1fc59c
[mlir][ArmSME] Rewrite illegal `shape_casts` to `vector.transpose` op…
MacDue Mar 7, 2024
630289f
[HIP] Do not include the CUID module hash with the new driver (#84332)
jhuber6 Mar 7, 2024
8f79cdd
[AArch64] Add -verify-machineinstrs to a test
jayfoad Mar 7, 2024
96049fc
[GISEL] Add IRTranslation for shufflevector on scalable vector types …
michaelmaitland Mar 7, 2024
3714f93
[MLIR] Add llvm (debug) attributes to CAPI (#83992)
edg-l Mar 7, 2024
6157538
[InstCombine] ptrmask of gep for dynamic pointer aligment (#80002)
JonChesterfield Mar 7, 2024
36f866c
Fix vfork test strcmp buildbot failure (#84224)
jeffreytan81 Mar 7, 2024
ee24409
Revert "[AArch64][GlobalISel] Fix incorrect selection of monotonic s3…
fmayer Mar 7, 2024
e9901d8
[LinkerWrapper] Accept compression arguments for HIP fatbins (#84337)
jhuber6 Mar 7, 2024
ea49e04
[lldb] Don't report all progress event as completed. (#84281)
JDevlieghere Mar 7, 2024
cfdfeb4
[clang][Interp][NFC] Remove unneeded forward declaration
tbaederr Mar 7, 2024
a435e1f
[acc] Add attribute for combined constructs (#80319)
razvanlupusoru Mar 7, 2024
6515930
[lldb] Minor cleanup in StoringDiagnosticConsumer (#84263)
kastiglione Mar 7, 2024
9e4f289
[clang][Interp][NFC] Add [[nodiscard]] attribute to emit functions
tbaederr Mar 7, 2024
4157217
[clang] Add CodeGen tests for CWG 5xx issues (#84303)
Endilll Mar 7, 2024
a6a6fca
[ubsan][pgo] Pass to remove ubsan checks based on profile data (#83471)
vitalybuka Mar 7, 2024
54c955b
Change the return type of ValueObject::CalculateNumChildren to uint32_t.
adrian-prantl Feb 29, 2024
3d7c5b8
Change the return type of SyntheticFrontend::CalculateNumChildren to …
adrian-prantl Feb 29, 2024
e710523
Change GetChildAtIndex to take a uint32_t
adrian-prantl Mar 5, 2024
6f29941
[TBAA] Add extra tests to copy structs with union members.
fhahn Mar 7, 2024
7fc583c
Change Get|SetNumChildren to use unint32_t
adrian-prantl Mar 6, 2024
c103d57
[libc] Fix forward missing `BigInt` specialization of `mask_leading_o…
gchatelet Mar 7, 2024
6e692e7
[mlir][sparse] Migrate to sparse_tensor.print (#83946)
yinying-lisa-li Mar 7, 2024
4cb5a96
[mlir][sparse] Migrate more tests to sparse_tensor.print (#84249)
yinying-lisa-li Mar 7, 2024
fc837f7
[gn build] Port a6a6fca7911f
llvmgnsyncbot Mar 7, 2024
3e73a08
[X86] Add tests for folding `(icmp ult (add x,-C),2)` -> `(or (icmp e…
goldsteinn Mar 6, 2024
9f96db8
[X86] Fold `(icmp ult (add x,-C),2)` -> `(or (icmp eq X,C), (icmp eq …
goldsteinn Mar 6, 2024
00f4121
[ORC][JITLink] Add Intel VTune support to JITLink (#83957)
Mar 7, 2024
d64632b
[gn build] Port 00f412168cf6
llvmgnsyncbot Mar 7, 2024
4d31fbb
[ORC] Propagate defineMaterializing failure when resource tracker is …
lhames Mar 7, 2024
9286665
AMDGPU: Use OtherPredicates for v_dot2_bf16_bf16(f16_f16) pseudo (#84…
changpeng Mar 7, 2024
b8b434b
[GISEL] Silence unused variable warning. NFC
d0k Mar 7, 2024
4f85f62
[bazel] Port 3714f937b835c06c8c32ca4f3f61ba2317db2296
d0k Mar 7, 2024
57a3373
[libc][c23] add memset_explicit (#83577)
SchrodingerZhu Mar 7, 2024
308a236
[clang-tidy] `isOnlyUsedAsConst`: Handle static method calls. (#84005)
legrosbuffle Mar 7, 2024
a10fd16
[CVP] Add test coverage for an upcoming generalization of expandUDivO…
preames Mar 7, 2024
292a28d
[libc++] Enable availability based on the compiler instead of __has_e…
ldionne Mar 7, 2024
d0b7022
[libc] Refactor stdfix extension from llvm_libc_ext.td to llvm_libc_s…
lntue Mar 7, 2024
a41226b
[ValueTracking] Fix KnownBits conflict for calls (range vs returned) …
bjope Mar 7, 2024
4586366
[lldb] Do some gardening in ProgressReportTest (NFC) (#84278)
JDevlieghere Mar 7, 2024
1118571
Revert "[SLP]Improve minbitwidth analysis."
alexey-bataev Mar 7, 2024
ecf7db8
[lldb] Disable shell tests affected by ld_new bug (#84246)
kastiglione Mar 7, 2024
641b98a
[GlobalISel] Fix crash in tryFoldAndOrOrICmpsUsingRanges() with point…
aemerson Mar 7, 2024
143afb4
[BOLT] Add reading support for Linux kernel .altinstructions section …
maksfb Mar 7, 2024
9cf9cb2
[clang] Upstream visionOS Availability & DarwinSDKInfo APIs (#84279)
cyndyishida Mar 7, 2024
ced1fac
[mlir][sparse] Move n:m printing into toMLIRString (#84264)
yinying-lisa-li Mar 7, 2024
167b90d
[TBAA] Add test showing tbaa.struct being generated with relaxed-alias.
fhahn Mar 7, 2024
a0c7714
[RISCV] Split div vs rem scheduling information [nfc] (#84385)
preames Mar 7, 2024
f78129e
[Orc] Add NotifyCreated callback for LLJITBuilder (#84175)
weliveindetail Mar 7, 2024
2a4a852
Reland [clang-repl] Expose setter for triple in IncrementalCompilerBu…
weliveindetail Mar 6, 2024
23d2c38
[gn build] Port 2a4a852a67ea
llvmgnsyncbot Mar 7, 2024
49b1fc4
[CVP] Freeze Y when expanding urem x, y with X < 2Y (#84390)
preames Mar 7, 2024
4867382
[ORC] Deallocate FinalizedAllocs on error paths in notifyEmitted.
lhames Mar 7, 2024
69b8bc7
[Dexter] Extend XFAIL of Dexter tests to all MacOS architectures. (#8…
dyung Mar 7, 2024
3a56b5a
[CUDA] Include PTX in non-RDC mode using the new driver (#84367)
jhuber6 Mar 7, 2024
14171b8
[libc][stdfix] Add exp function for short _Accum and _Accum types. (#…
lntue Mar 7, 2024
909ab0e
[RISCV] Insert a freeze before converting select to AND/OR. (#84232)
topperc Mar 7, 2024
d93a126
[lldb] Add ability to detect darwin host linker version to xfail test…
bulbazord Mar 7, 2024
1c01651
[libc][docs] add page linking to talks (#84393)
nickdesaulniers Mar 7, 2024
10edabb
[X86][GlobalISel] Enable G_SDIV/G_UDIV/G_SREM/G_UREM (#81615)
e-kud Mar 7, 2024
5d33f71
Fix build: llvm::Error needs to be moved for implicit conversion to E…
joker-eph Mar 7, 2024
5669660
[MLIR] XeGPU dialect for Intel GPU - core definitions and base classe…
chencha3 Mar 7, 2024
a9b0d75
[BOLT] Properly propagate Cursor errors (#84378)
maksfb Mar 7, 2024
50ae8a2
[InstallAPI] Collect global functions (#83952)
cyndyishida Mar 7, 2024
3712edb
[libc] finish documenting c23 additions (#84383)
nickdesaulniers Mar 7, 2024
293ec48
[libc] rename cpp::count_ones to cpp::popcount to better mirror std::…
nickdesaulniers Mar 7, 2024
f862265
AMDGPU: Use True16Predicate for UseRealTrue16Insts in VOP2 Reals (#84…
changpeng Mar 7, 2024
a01e9ce
[AArc64][GlobalISel] Fix legalizer assert for G_INSERT_VECTOR_ELT
aemerson Mar 7, 2024
3e5afba
[NFC] [hwasan] be consistent about how to get integer types (#84396)
fmayer Mar 7, 2024
ddf79de
[Asan] Fix -Wunused-private-field in non-assertion builds (NFC)
DamonFool Mar 7, 2024
8bf8d36
[compiler-rt][fuzzer] Reland "SetThreadName windows implementation" (…
devnexen Mar 7, 2024
26fa440
[GlobalISel] Fix yet another pointer type invalid combining issue, th…
aemerson Mar 7, 2024
b408241
[compiler-rt] adding fchmodat2 syscall introduced in Linux 6.6. (#82275)
devnexen Mar 8, 2024
487cfbe
[Clang] Implement constexpr support for `__builtin_popcountg` (#84318)
overmighty Mar 8, 2024
e932fe8
[compiler-rt][Fuzzer] fix windows typo (#84407)
devnexen Mar 8, 2024
0d4978f
[RISCV] Update some tests I missed in 909ab0e0d1903ad2329ca9fdf248d21…
topperc Mar 7, 2024
fcd2d48
[OpenMP] runtime support for efficient partitioning of collapsed tria…
vadikp-intel Mar 8, 2024
0cd7942
[llvm-dwarfdump] Fix parsing DW_CFA_AARCH64_negate_ra_state (#84128)
igorkudrin Mar 8, 2024
fe84764
[DWARF] Dump an updated location for DW_CFA_advance_loc* (#84274)
igorkudrin Mar 8, 2024
99512b1
[Object] Convert tests to opaque pointers (NFC)
MaskRay Mar 8, 2024
30f098e
[Instrumentation] Convert tests to opaque pointers (NFC)
MaskRay Mar 8, 2024
9d3bf9b
[NFC] [hwasan] consistent naming for cl::opt
fmayer Mar 8, 2024
fb582b6
[mlir] Implement Mesh's ShardingInterface for Linalg ops (#82284)
sogartar Mar 8, 2024
ddaf040
[mlir][Transforms][NFC] Make signature conversion more efficient (#83…
matthias-springer Mar 8, 2024
e7a22e7
[PPC] precommit cases for issue 74915
Mar 8, 2024
60a20bd
[mlir][Transforms] Add listener support to dialect conversion (#83425)
matthias-springer Mar 8, 2024
474a73d
[mlir] Fix build failure in MeshShardingInterfaceImpl.cpp (NFC)
DamonFool Mar 8, 2024
da4957b
[NFC] [hwasan] use for_each and move comment
fmayer Mar 8, 2024
cc34e56
[PPC][NFC] add an option to expose the bug in 74951
Mar 8, 2024
da00c60
[C++20] [Modules] Introduce reduced BMI (#75894)
ChuanqiXu9 Mar 8, 2024
a4703e5
[clang] Remove std::move in GenerateModuleAction::CreateMultiplexCons…
DamonFool Mar 8, 2024
4484190
update_test_checks: precommit a test case
nhaehnle Nov 23, 2023
fc1e5f9
update_test_checks: simplify is_local_def_ir_value
nhaehnle Dec 23, 2023
5747f9d
update_test_checks: simplify get_ir_regex
nhaehnle Dec 23, 2023
fb02f9a
update_test_checks: keep meta variables stable by default
nhaehnle Nov 23, 2023
51b7ef9
[libc][NFC] Fix a typo in test/src/stdfix/RoundTest.h. (#84411)
lntue Mar 8, 2024
66bd3cd
[AMDGPU,test] Change llc -march= to -mtriple=
MaskRay Mar 8, 2024
b565126
Revert "update_test_checks: keep meta variables stable by default"
nhaehnle Mar 8, 2024
3846019
update_test_checks: keep meta variables stable by default
nhaehnle Nov 23, 2023
d9c8550
[flang] Fixed build issues after f20ea05. (#84377)
vzakhari Mar 8, 2024
23c658a
[AArch64] Ensure Neoverse V1 scheduling model includes all SVE pseudo…
davemgreen Mar 8, 2024
2d539db
[clang][dataflow] When analyzing ctors, don't initialize fields of `*…
martinboehme Mar 8, 2024
9b74c43
[clang][dataflow] Add context-sensitive test for returning a record b…
martinboehme Mar 8, 2024
bfa6444
[compiler-rt] Fix incorrect usages of check_cxx_compiler_flag
arichardson Mar 8, 2024
4466520
Merge commit '99500e8c08a4d941acb8a7eb00523296fb2acf7a' into jose.pos…
josel-amd Aug 7, 2024
4889a58
Merge commit '469c5e3da46115b9625e2d4771bd19d4968e3fa9' into jose.pos…
josel-amd Aug 7, 2024
6b9eab2
Merge commit 'afac64cef40c77320cc49808be30f3e5ef7f7357' into jose.bump_4
josel-amd Aug 7, 2024
5aac423
Merge commit '6f54a54c6f5f644b4f4c79882154fd9737568c8e' into jose.bump_5
josel-amd Aug 7, 2024
768d339
Merge commit 'c40146c214a705a232848144d9412c8a7c73f0fe' into jose.bump_5
josel-amd Aug 7, 2024
88698cc
Fix merge problem
josel-amd Aug 7, 2024
4399998
Merge branch 'jose.bump_4' into jose.bump_5
josel-amd Aug 7, 2024
bc3916d
Merge commit 'e4d4cfa5a0111372dff2b01126545cf3139ee40b' into jose.bump_6
josel-amd Aug 7, 2024
9c0a083
Merge commit 'f355cd6f6c51580316e1e88ef5534bd2f8cfa498' into jose.bump_7
josel-amd Aug 7, 2024
18addab
Merge commit 'bfa6444a332f82843f9fa44821d68fcc772e0272' into jose.bump_8
josel-amd Aug 8, 2024
826a499
Merge pull request #243 from Xilinx/jose.bump_8
josel-amd Aug 8, 2024
334b09f
Merge pull request #242 from Xilinx/jose.bump_7
josel-amd Aug 8, 2024
c9901d0
Merge pull request #241 from Xilinx/jose.bump_6
josel-amd Aug 8, 2024
202aa38
Merge pull request #240 from Xilinx/jose.bump_5
josel-amd Aug 8, 2024
48c15f5
Merge pull request #239 from Xilinx/jose.bump_4
josel-amd Aug 8, 2024
a9423f9
Merge pull request #238 from Xilinx/jose.post_march_7_3
josel-amd Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ C++23 Feature Support
- Implemented `P2718R0: Lifetime extension in range-based for loops <https://wg21.link/P2718R0>`_. Also
materialize temporary object which is a prvalue in discarded-value expression.

- Implemented `P2448R2: Relaxing some constexpr restrictions <https://wg21.link/P2448R2>`_.

C++2c Feature Support
^^^^^^^^^^^^^^^^^^^^^

Expand Down
26 changes: 7 additions & 19 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -9607,13 +9607,10 @@ def err_defaulted_copy_assign_not_ref : Error<
"the parameter for an explicitly-defaulted copy assignment operator must be an "
"lvalue reference type">;
def err_incorrect_defaulted_constexpr : Error<
"defaulted definition of %sub{select_special_member_kind}0 "
"is not constexpr">;
"defaulted definition of %sub{select_special_member_kind}0 cannot be marked %select{constexpr|consteval}1 "
"before C++23">;
def err_incorrect_defaulted_constexpr_with_vb: Error<
"%sub{select_special_member_kind}0 cannot be 'constexpr' in a class with virtual base class">;
def err_incorrect_defaulted_consteval : Error<
"defaulted declaration of %sub{select_special_member_kind}0 "
"cannot be consteval because implicit definition is not constexpr">;
def warn_defaulted_method_deleted : Warning<
"explicitly defaulted %sub{select_special_member_kind}0 is implicitly "
"deleted">, InGroup<DefaultedFunctionDeleted>;
Expand Down Expand Up @@ -9724,21 +9721,12 @@ def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note<
"%select{|member|base class}0 %1 declared here">;
def note_defaulted_comparison_cannot_deduce_callee : Note<
"selected 'operator<=>' for %select{|member|base class}0 %1 declared here">;
def ext_defaulted_comparison_constexpr_mismatch : Extension<
def err_defaulted_comparison_constexpr_mismatch : Error<
"defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
"three-way comparison operator}0 that is "
"declared %select{constexpr|consteval}2 but"
"%select{|for which the corresponding implicit 'operator==' }0 "
"invokes a non-constexpr comparison function is a C++23 extension">,
InGroup<DiagGroup<"c++23-default-comp-relaxed-constexpr">>;
def warn_cxx23_compat_defaulted_comparison_constexpr_mismatch : Warning<
"defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|"
"three-way comparison operator}0 that is "
"declared %select{constexpr|consteval}2 but"
"%select{|for which the corresponding implicit 'operator==' }0 "
"invokes a non-constexpr comparison function is incompatible with C++ "
"standards before C++23">,
InGroup<CXXPre23Compat>, DefaultIgnore;
"three-way comparison operator}0 cannot be "
"declared %select{constexpr|consteval}2 because "
"%select{it|for which the corresponding implicit 'operator==' }0 "
"invokes a non-constexpr comparison function ">;
def note_defaulted_comparison_not_constexpr : Note<
"non-constexpr comparison function would be used to compare "
"%select{|member %1|base class %1}0">;
Expand Down
13 changes: 8 additions & 5 deletions clang/lib/AST/DeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,11 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,

// C++11 [class.ctor]p6:
// If that user-written default constructor would satisfy the
// requirements of a constexpr constructor, the implicitly-defined
// default constructor is constexpr.
// requirements of a constexpr constructor/function(C++23), the
// implicitly-defined default constructor is constexpr.
if (!BaseClassDecl->hasConstexprDefaultConstructor())
data().DefaultedDefaultConstructorIsConstexpr = false;
data().DefaultedDefaultConstructorIsConstexpr =
C.getLangOpts().CPlusPlus23;

// C++1z [class.copy]p8:
// The implicitly-declared copy constructor for a class X will have
Expand Down Expand Up @@ -548,7 +549,8 @@ void CXXRecordDecl::addedClassSubobject(CXXRecordDecl *Subobj) {
// -- for every subobject of class type or (possibly multi-dimensional)
// array thereof, that class type shall have a constexpr destructor
if (!Subobj->hasConstexprDestructor())
data().DefaultedDestructorIsConstexpr = false;
data().DefaultedDestructorIsConstexpr =
getASTContext().getLangOpts().CPlusPlus23;

// C++20 [temp.param]p7:
// A structural type is [...] a literal class type [for which] the types
Expand Down Expand Up @@ -1297,7 +1299,8 @@ void CXXRecordDecl::addedMember(Decl *D) {
!FieldRec->hasConstexprDefaultConstructor() && !isUnion())
// The standard requires any in-class initializer to be a constant
// expression. We consider this to be a defect.
data().DefaultedDefaultConstructorIsConstexpr = false;
data().DefaultedDefaultConstructorIsConstexpr =
Context.getLangOpts().CPlusPlus23;

// C++11 [class.copy]p8:
// The implicitly-declared copy constructor for a class X will have
Expand Down
93 changes: 52 additions & 41 deletions clang/lib/Sema/SemaDeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,8 @@ static bool CheckLiteralType(Sema &SemaRef, Sema::CheckConstexprKind Kind,
static bool CheckConstexprDestructorSubobjects(Sema &SemaRef,
const CXXDestructorDecl *DD,
Sema::CheckConstexprKind Kind) {
assert(!SemaRef.getLangOpts().CPlusPlus23 &&
"this check is obsolete for C++23");
auto Check = [&](SourceLocation Loc, QualType T, const FieldDecl *FD) {
const CXXRecordDecl *RD =
T->getBaseElementTypeUnsafe()->getAsCXXRecordDecl();
Expand Down Expand Up @@ -1746,6 +1748,8 @@ static bool CheckConstexprDestructorSubobjects(Sema &SemaRef,
static bool CheckConstexprParameterTypes(Sema &SemaRef,
const FunctionDecl *FD,
Sema::CheckConstexprKind Kind) {
assert(!SemaRef.getLangOpts().CPlusPlus23 &&
"this check is obsolete for C++23");
unsigned ArgIndex = 0;
const auto *FT = FD->getType()->castAs<FunctionProtoType>();
for (FunctionProtoType::param_type_iterator i = FT->param_type_begin(),
Expand All @@ -1767,6 +1771,8 @@ static bool CheckConstexprParameterTypes(Sema &SemaRef,
/// true. If not, produce a suitable diagnostic and return false.
static bool CheckConstexprReturnType(Sema &SemaRef, const FunctionDecl *FD,
Sema::CheckConstexprKind Kind) {
assert(!SemaRef.getLangOpts().CPlusPlus23 &&
"this check is obsolete for C++23");
if (CheckLiteralType(SemaRef, Kind, FD->getLocation(), FD->getReturnType(),
diag::err_constexpr_non_literal_return,
FD->isConsteval()))
Expand Down Expand Up @@ -1856,25 +1862,28 @@ bool Sema::CheckConstexprFunctionDefinition(const FunctionDecl *NewFD,
}
}

// - its return type shall be a literal type;
if (!CheckConstexprReturnType(*this, NewFD, Kind))
// - its return type shall be a literal type; (removed in C++23)
if (!getLangOpts().CPlusPlus23 &&
!CheckConstexprReturnType(*this, NewFD, Kind))
return false;
}

if (auto *Dtor = dyn_cast<CXXDestructorDecl>(NewFD)) {
// A destructor can be constexpr only if the defaulted destructor could be;
// we don't need to check the members and bases if we already know they all
// have constexpr destructors.
if (!Dtor->getParent()->defaultedDestructorIsConstexpr()) {
// have constexpr destructors. (removed in C++23)
if (!getLangOpts().CPlusPlus23 &&
!Dtor->getParent()->defaultedDestructorIsConstexpr()) {
if (Kind == CheckConstexprKind::CheckValid)
return false;
if (!CheckConstexprDestructorSubobjects(*this, Dtor, Kind))
return false;
}
}

// - each of its parameter types shall be a literal type;
if (!CheckConstexprParameterTypes(*this, NewFD, Kind))
// - each of its parameter types shall be a literal type; (removed in C++23)
if (!getLangOpts().CPlusPlus23 &&
!CheckConstexprParameterTypes(*this, NewFD, Kind))
return false;

Stmt *Body = NewFD->getBody();
Expand Down Expand Up @@ -2457,7 +2466,8 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl,
// function", so is not checked in CheckValid mode.
SmallVector<PartialDiagnosticAt, 8> Diags;
if (Kind == Sema::CheckConstexprKind::Diagnose &&
!Expr::isPotentialConstantExpr(Dcl, Diags)) {
!Expr::isPotentialConstantExpr(Dcl, Diags) &&
!SemaRef.getLangOpts().CPlusPlus23) {
SemaRef.Diag(Dcl->getLocation(),
diag::ext_constexpr_function_never_constant_expr)
<< isa<CXXConstructorDecl>(Dcl) << Dcl->isConsteval()
Expand Down Expand Up @@ -7535,21 +7545,23 @@ static bool defaultedSpecialMemberIsConstexpr(

// C++1y [class.copy]p26:
// -- [the class] is a literal type, and
if (!Ctor && !ClassDecl->isLiteral())
if (!Ctor && !ClassDecl->isLiteral() && !S.getLangOpts().CPlusPlus23)
return false;

// -- every constructor involved in initializing [...] base class
// sub-objects shall be a constexpr constructor;
// -- the assignment operator selected to copy/move each direct base
// class is a constexpr function, and
for (const auto &B : ClassDecl->bases()) {
const RecordType *BaseType = B.getType()->getAs<RecordType>();
if (!BaseType)
continue;
CXXRecordDecl *BaseClassDecl = cast<CXXRecordDecl>(BaseType->getDecl());
if (!specialMemberIsConstexpr(S, BaseClassDecl, CSM, 0, ConstArg,
InheritedCtor, Inherited))
return false;
if (!S.getLangOpts().CPlusPlus23) {
for (const auto &B : ClassDecl->bases()) {
const RecordType *BaseType = B.getType()->getAs<RecordType>();
if (!BaseType)
continue;
CXXRecordDecl *BaseClassDecl = cast<CXXRecordDecl>(BaseType->getDecl());
if (!specialMemberIsConstexpr(S, BaseClassDecl, CSM, 0, ConstArg,
InheritedCtor, Inherited))
return false;
}
}

// -- every constructor involved in initializing non-static data members
Expand All @@ -7559,20 +7571,22 @@ static bool defaultedSpecialMemberIsConstexpr(
// -- for each non-static data member of X that is of class type (or array
// thereof), the assignment operator selected to copy/move that member is
// a constexpr function
for (const auto *F : ClassDecl->fields()) {
if (F->isInvalidDecl())
continue;
if (CSM == Sema::CXXDefaultConstructor && F->hasInClassInitializer())
continue;
QualType BaseType = S.Context.getBaseElementType(F->getType());
if (const RecordType *RecordTy = BaseType->getAs<RecordType>()) {
CXXRecordDecl *FieldRecDecl = cast<CXXRecordDecl>(RecordTy->getDecl());
if (!specialMemberIsConstexpr(S, FieldRecDecl, CSM,
BaseType.getCVRQualifiers(),
ConstArg && !F->isMutable()))
if (!S.getLangOpts().CPlusPlus23) {
for (const auto *F : ClassDecl->fields()) {
if (F->isInvalidDecl())
continue;
if (CSM == Sema::CXXDefaultConstructor && F->hasInClassInitializer())
continue;
QualType BaseType = S.Context.getBaseElementType(F->getType());
if (const RecordType *RecordTy = BaseType->getAs<RecordType>()) {
CXXRecordDecl *FieldRecDecl = cast<CXXRecordDecl>(RecordTy->getDecl());
if (!specialMemberIsConstexpr(S, FieldRecDecl, CSM,
BaseType.getCVRQualifiers(),
ConstArg && !F->isMutable()))
return false;
} else if (CSM == Sema::CXXDefaultConstructor) {
return false;
} else if (CSM == Sema::CXXDefaultConstructor) {
return false;
}
}
}

Expand Down Expand Up @@ -7858,18 +7872,17 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD,
MD->isConstexpr() && !Constexpr &&
MD->getTemplatedKind() == FunctionDecl::TK_NonTemplate) {
if (!MD->isConsteval() && RD->getNumVBases()) {
Diag(MD->getBeginLoc(), diag::err_incorrect_defaulted_constexpr_with_vb)
Diag(MD->getBeginLoc(),
diag::err_incorrect_defaulted_constexpr_with_vb)
<< CSM;
for (const auto &I : RD->vbases())
Diag(I.getBeginLoc(), diag::note_constexpr_virtual_base_here);
} else {
Diag(MD->getBeginLoc(), MD->isConsteval()
? diag::err_incorrect_defaulted_consteval
: diag::err_incorrect_defaulted_constexpr)
<< CSM;
Diag(MD->getBeginLoc(), diag::err_incorrect_defaulted_constexpr)
<< CSM << MD->isConsteval();
}
// FIXME: Explain why the special member can't be constexpr.
HadError = true;
HadError = true;
// FIXME: Explain why the special member can't be constexpr.
}

if (First) {
Expand Down Expand Up @@ -9101,13 +9114,11 @@ bool Sema::CheckExplicitlyDefaultedComparison(Scope *S, FunctionDecl *FD,
// - if the function is a constructor or destructor, its class does not
// have any virtual base classes.
if (FD->isConstexpr()) {
if (CheckConstexprReturnType(*this, FD, CheckConstexprKind::Diagnose) &&
if (!getLangOpts().CPlusPlus23 &&
CheckConstexprReturnType(*this, FD, CheckConstexprKind::Diagnose) &&
CheckConstexprParameterTypes(*this, FD, CheckConstexprKind::Diagnose) &&
!Info.Constexpr) {
Diag(FD->getBeginLoc(),
getLangOpts().CPlusPlus23
? diag::warn_cxx23_compat_defaulted_comparison_constexpr_mismatch
: diag::ext_defaulted_comparison_constexpr_mismatch)
Diag(FD->getBeginLoc(), diag::err_defaulted_comparison_constexpr_mismatch)
<< FD->isImplicit() << (int)DCK << FD->isConsteval();
DefaultedComparisonAnalyzer(*this, RD, FD, DCK,
DefaultedComparisonAnalyzer::ExplainConstexpr)
Expand Down
Loading