[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-31 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. > I agree this is a bug in libc++ and we should fix it. As mentioned I'm not > too familiar with ranges. Thanks! I submitted https://github.com/llvm/llvm-project/issues/64250 so we don't forget about it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-26 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added a subscriber: var-const. Mordante added a comment. In D152003#4534963 , @Fznamznon wrote: >> What do you mean with libstdc++ is fine? > > What I mean is when I do (current patch is applied to clang): > > source/llvm-project/build/bin/clan

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-26 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. > What do you mean with libstdc++ is fine? What I mean is when I do (current patch is applied to clang): source/llvm-project/build/bin/clang++ -std=c++20 t.cpp -c // compilation succeeds But when I do (libc++ is built together with clang) source/llvm-project/bui

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added a comment. In D152003#4531404 , @Fznamznon wrote: >> should we try to land that today? > > I'm not sure. It causes failures in libc++ testing: > > Failed Tests (3): > llvm-libc++-shared.cfg.in :: std/ranges/range.access/end.pass.cpp >

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. I think getting a smaller reproducer would be useful indeed before talking about conformance, even though i think there is indeed something wrong there - an incomplete parameter should not be able to produce a valid call. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added a comment. In D152003#4531732 , @aaron.ballman wrote: > In D152003#4531404 , @Fznamznon > wrote: > >>> should we try to land that today? >> >> I'm not sure. It causes failures in libc++ testing: >>

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added subscribers: philnik, Mordante, ldionne. aaron.ballman added a comment. In D152003#4531404 , @Fznamznon wrote: >> should we try to land that today? > > I'm not sure. It causes failures in libc++ testing: > > Failed Tests (3): > l

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. > should we try to land that today? I'm not sure. It causes failures in libc++ testing: Failed Tests (3): llvm-libc++-shared.cfg.in :: std/ranges/range.access/end.pass.cpp llvm-libc++-shared.cfg.in :: std/ranges/range.access/rbegin.pass.cpp llvm-libc++-sh

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. This looks reasonable to me know. should we try to land that today? Sorry i could not get to it earlier! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-19 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 541915. Fznamznon added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaType.cpp clang

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a subscriber: hubert.reinterpretcast. aaron.ballman added inline comments. Comment at: clang/test/SemaCXX/paren-list-agg-init.cpp:276-285 +namespace gh62863 { +int (&&arr)[] = static_cast(42); +// beforecxx20-warning@-1 {{aggregate initialization of type 'int[

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-12 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 539502. Fznamznon added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaType.cpp clang

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-12 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-07 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 538165. Fznamznon added a comment. Rebase, move the logic, modify c-style casts as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003 Files: clang/docs/ReleaseN

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-05 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/test/SemaCXX/paren-list-agg-init.cpp:276-285 +namespace gh62863 { +int (&&arr)[] = static_cast(42); +// beforecxx20-warning@-1 {{aggregate initialization of type 'int[1]' from a parenthesized list of values is a C++20 extension}

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-05 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: clang-language-wg, cor3ntin. aaron.ballman added a comment. Thank you for working on this! Comment at: clang/lib/Sema/SemaCast.cpp:1269-1272 +ResultType = Self.Context.getConstantArrayType( +IAT->getElementType(), +llvm::APInt(

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-05 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. Ping for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-30 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 536172. Fznamznon added a comment. Move changes to another place, check destination type Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003 Files: clang/docs/Release

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-29 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:8824 + if (auto *Cast = dyn_cast(E)) { +if (auto *SubInit = dyn_cast(Cast->getSubExpr())) { + const Type *InnerType = SubInit->getType().getTypePtr(); erichkeane wrote: > Fznamznon

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:8824 + if (auto *Cast = dyn_cast(E)) { +if (auto *SubInit = dyn_cast(Cast->getSubExpr())) { + const Type *InnerType = SubInit->getType().getTypePtr(); Fznamznon wrote: > erichkean

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-05 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:8824 + if (auto *Cast = dyn_cast(E)) { +if (auto *SubInit = dyn_cast(Cast->getSubExpr())) { + const Type *InnerType = SubInit->getType().getTypePtr(); erichkeane wrote: > Fznamznon

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-02 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:8824 + if (auto *Cast = dyn_cast(E)) { +if (auto *SubInit = dyn_cast(Cast->getSubExpr())) { + const Type *InnerType = SubInit->getType().getTypePtr(); Fznamznon wrote: > erichkean

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-02 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:8824 + if (auto *Cast = dyn_cast(E)) { +if (auto *SubInit = dyn_cast(Cast->getSubExpr())) { + const Type *InnerType = SubInit->getType().getTypePtr(); erichkeane wrote: > I am not

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-02 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:8824 + if (auto *Cast = dyn_cast(E)) { +if (auto *SubInit = dyn_cast(Cast->getSubExpr())) { + const Type *InnerType = SubInit->getType().getTypePtr(); I am not really sure this is

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-06-02 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon created this revision. Herald added a project: All. Fznamznon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Per P1975R0 an expression like `static_cast(...)` defines the type of the expression as U[1]. Fixes https://github.com/