[Bug c++/95022] New: ICE: expected integer_cst, have call_expr

2020-05-09 Thread john at mcfarlane dot name
++ Assignee: unassigned at gcc dot gnu.org Reporter: john at mcfarlane dot name Target Milestone: --- Doesn't occur with g++-9 but does happen with Ubuntu 20.04 GCC-10 and at head w. SHA a33649e6 Ubuntu 20.04 GCC-10: john@carbon:~/ws/gcc/build$ g++ --version g++ (Ubuntu 10-202

[Bug c++/94955] [10/11 Regression] ICE in to_wide

2020-05-11 Thread john at mcfarlane dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94955 --- Comment #5 from John McFarlane --- I have applied a workaround and am not blocked: https://github.com/johnmcfarlane/cnl/pull/589/commits/ca3478ed0002e5834227d7b6fa0010910aabc875

[Bug c++/85125] constant expression with const_cast UB does not emit error

2018-04-15 Thread john at mcfarlane dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85125 --- Comment #2 from John McFarlane --- Here are two more: constexpr int dubious_increment(int i) { return ++i + ++i; } static_assert(dubious_increment(0) == 3); constexpr int dubious_increment(int i) { return i; } static_ass

[Bug c++/85125] constant expression with const_cast UB does not emit error

2019-09-01 Thread john at mcfarlane dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85125 --- Comment #7 from John McFarlane --- Confirmed. Thank you! On Mon, 19 Aug 2019 at 15:02, mpolacek at gcc dot gnu.org < gcc-bugzi...@gcc.gnu.org> wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85125 > > Marek Polacek changed: > >

[Bug c++/85125] New: constant expression with const_cast UB does not emit error

2018-03-29 Thread john at mcfarlane dot name
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: john at mcfarlane dot name Target Milestone: --- Tested in godbolt.org ([example](https://godbolt.org/g/dhtXmH)) with x86-64 versions from 5.1 to 7.3 and trunk. Options are `-Wall -Wextra` but

[Bug c++/82047] New: non-existent variable template used to initialize variable

2017-08-30 Thread john at mcfarlane dot name
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: john at mcfarlane dot name Target Milestone: --- The following code compiles: template struct S {}; template constexpr T v; constexpr auto c = v>; The result is a variable of type `struc

[Bug c++/82047] non-existent variable template used to initialize variable

2017-08-31 Thread john at mcfarlane dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047 --- Comment #3 from John McFarlane --- This still happens when S has member variables. For example, if `S` is replaced with `std::complex`, then `v>` is `{0,0}`.

[Bug c++/82226] New: previously instantiation of template type breaks future use

2017-09-15 Thread john at mcfarlane dot name
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: john at mcfarlane dot name Target Milestone: --- The following fragment fails to compile because the second `static_assert` fires incorrectly. Removing the first `static_assert` causes the

[Bug c++/82226] previous instantiation of template type breaks future use

2017-10-25 Thread john at mcfarlane dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82226 --- Comment #2 from John McFarlane --- 79092?

[Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc:

2020-10-19 Thread john at mcfarlane dot name via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93297 John McFarlane changed: What|Removed |Added CC||john at mcfarlane dot name --- Comment

[Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc:

2020-10-19 Thread john at mcfarlane dot name via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93297 --- Comment #8 from John McFarlane --- And this input can generate an ICE even with the -std=c++2a switch: template class a; template a()->a; template <2> using c a; static_assert(c{ } CL: g++ -v -std=c++2a source.cpp Online

[Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc:

2020-10-22 Thread john at mcfarlane dot name via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93297 --- Comment #9 from John McFarlane --- And here is an ICE in 10.2: struct a; template class b; template b()->b<>; template using c = b; static_assert(c{} CL: g++ -v -std=c++2a source.cpp Online: https://godbolt.org/z/54aTr6

[Bug c++/103483] New: constexpr basic_string triggers stringop-overread

2021-11-29 Thread john at mcfarlane dot name via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: john at mcfarlane dot name Target Milestone: --- As of 9a27acc30a34b7854db32eac562306cebac6fa1e, "Make full use of context-sensitive ranges in access warnings.", this source.cpp #include template vo

[Bug middle-end/103483] context-sensitive ranges change triggers stringop-overread

2021-11-30 Thread john at mcfarlane dot name via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103483 --- Comment #5 from John McFarlane --- Here is an example of the real-world code causing this warning: https://github.com/johnmcfarlane/cnl/blob/6d46b6cf10a998e3bdcc32557f202c8579b5717c/test/unit/scaled_int/to_chars.h#L60 It is converting a num

[Bug c++/102303] New: optimizer elides -ftrapv overflow detection

2021-09-13 Thread john at mcfarlane dot name via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: john at mcfarlane dot name Target Milestone: --- With flag, `-ftrapv`, the following program on CE with 'x86-64 gcc 11.2' has exit status 139: int main() { int n = 0x7fff; return n+1;