Repository navigation
C++20+: constant evaluation erroneous failure involving allocation and range for #199
ilazaric
started this conversation in
Issue Triage - Compilation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
Statement
for (auto _ : foo());seems to break in constexpr if the objectfoo()returns involves a sufficiently large allocation.This snippet compiles with
--c++20 -DNUM=1354, and fails to compile with--c++20 -DNUM=1355.Failure:
On godbolt: https://godbolt.org/z/zKP5shPnn
Same example except the range for is
for (auto&& _ : vec());breaks with a significantly smallerNUM=678.On godbolt: https://godbolt.org/z/x5Mb9qa5v
Reproducing Source Code
Command-line Options
cpfe --c++20 -DNUM=1355 repro.cpp
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
No response
Reproducing (Standard) Configuration(s)
linux-gcc-release
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions