[Bug c++/102284] Can access object outside of its lifetime during constant evaluation

2022-09-26 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102284 --- Comment #7 from Johel Ernesto Guerrero Peña --- This may be related. Assigning to another member doesn't end the lifetime of the active one: https://godbolt.org/z/eMGY5ehnb. ```C++ #include struct symbol { }; constexpr symbol one{}; str

[Bug c++/107079] New: ICE initializing lifetime-extended constexpr variable that stores its this pointer

2022-09-28 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/5asqcnoMe. ```C++ struct X { const X* x

[Bug c++/107222] New: const qualifier appears in mangled NTTP value when the original object is so qualified

2022-10-11 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://compiler-explorer.com/z/63f9sxnec. ```C++ struct A { int

[Bug c++/107276] New: ICE Deducting return type from ill-formed structured binding name

2022-10-15 Thread johelegp at gmail dot com via Gcc-bugs
-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://compiler-explorer.com/z/6MqKTjKd7

[Bug c++/103339] [modules] ICE in exporting module on use of outside specialization

2022-10-17 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103339 --- Comment #5 from Johel Ernesto Guerrero Peña --- You're right. Feel free to close.

[Bug c++/107276] ICE Deducing return type from ill-formed structured binding name

2022-10-19 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107276 --- Comment #2 from Johel Ernesto Guerrero Peña --- I just compiled GCC and it still ICEs: ```cli $ ../root/gcc/bin/g++ --version g++ (GCC) 13.0.0 20221019 (experimental) Copyright (C) 2022 Free Software Foundation, Inc. This is free software;

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2021-12-30 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840 --- Comment #4 from Johel Ernesto Guerrero Peña --- Seems like this regressed. Do I open a new bug report?

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2021-12-30 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840 --- Comment #5 from Johel Ernesto Guerrero Peña --- I think I was wrong and this has not regressed.

[Bug c++/103876] New: Parameter pack not expanded in lambda within static_assert in a fold-expression of a lambda

2021-12-31 Thread johelegp at gmail dot com via Gcc-bugs
Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z

[Bug c++/103921] New: [modules] ICE requires in explicit-specifier of instantiation of imported template

2022-01-05 Thread johelegp at gmail dot com via Gcc-bugs
Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/Tb1eMbE3W

[Bug c++/103921] [modules] ICE requires in explicit-specifier of instantiation of imported template

2022-01-05 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103921 --- Comment #1 from Johel Ernesto Guerrero Peña --- Simplified: https://godbolt.org/z/zzbjj7W3K. mod.cpp: ```C++ export module mod; export template struct quantity { template explicit(requires { 0; }) operator quantity() const; }; ``` tes

[Bug c++/103921] [modules] ICE dependent expression in explicit-specifier of instantiation of imported template

2022-01-05 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103921 Johel Ernesto Guerrero Peña changed: What|Removed |Added Summary|[modules] ICE requires in |[modules] ICE dependent

[Bug c++/103921] [modules] ICE dependent expression in explicit-specifier of instantiation of imported template

2022-01-05 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103921 --- Comment #3 from Johel Ernesto Guerrero Peña --- Simplified: https://godbolt.org/z/rnfKrzYaP. mod.cpp: ```C++ export module mod; export template struct Int { explicit(B) operator int() const; }; ``` test.cpp: ```C++ import mod; int main(

[Bug c++/103921] [modules] ICE dependent expression in explicit-specifier of instantiation of imported template

2022-01-05 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103921 --- Comment #4 from Johel Ernesto Guerrero Peña --- For the above, when it's fixed: ```diff - explicit(B) operator int() const; + explicit(B) operator int() { return 0; } ```

[Bug c++/99571] ICE for NTTP with pointer to a field inside anonymous union/struct

2022-01-19 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99571 --- Comment #3 from Johel Ernesto Guerrero Peña --- > Here is another testcase which shows a similar issue: Here's its link: https://godbolt.org/z/fMbYMMYKz. You posted the Comment 0's. > Note clang has a bogus warning for the above about the a

[Bug c++/103752] [12 Regression][ICE][modules] with import

2022-02-09 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103752 Johel Ernesto Guerrero Peña changed: What|Removed |Added CC||johelegp at gmail dot com

[Bug c++/103921] [modules] ICE dependent expression in explicit-specifier of instantiation of imported template

2022-02-09 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103921 Johel Ernesto Guerrero Peña changed: What|Removed |Added Resolution|--- |DUPLICATE Sta

[Bug c++/103752] [12 Regression][ICE][modules] with import

2022-02-09 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103752 --- Comment #5 from Johel Ernesto Guerrero Peña --- *** Bug 103921 has been marked as a duplicate of this bug. ***

[Bug c++/103524] [meta-bug] modules issue

2022-02-09 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524 Bug 103524 depends on bug 103921, which changed state. Bug 103921 Summary: [modules] ICE dependent expression in explicit-specifier of instantiation of imported template https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103921 What|Re

[Bug c++/100617] [modules] Exported namespace not visible from outside when the module imports another module that declares the same namespace

2022-02-11 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100617 --- Comment #3 from Johel Ernesto Guerrero Peña --- (In reply to wang ivor from comment #1) > A workaround is to create a module that exports only the namespace A and > 'export import' it in the module 'test1'. I did that, but it's not enough.

[Bug c++/103118] [modules] ICE tree check in get_merge_kind at cp/module.cc

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118 Johel Ernesto Guerrero Peña changed: What|Removed |Added Resolution|--- |FIXED Status|

[Bug c++/99227] [meta] [modules] Bugs relating to header-units of STL header files

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99227 Bug 99227 depends on bug 103118, which changed state. Bug 103118 Summary: [modules] ICE tree check in get_merge_kind at cp/module.cc https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118 What|Removed |Added --

[Bug c++/103524] [meta-bug] modules issue

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524 Bug 103524 depends on bug 103118, which changed state. Bug 103118 Summary: [modules] ICE tree check in get_merge_kind at cp/module.cc https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118 What|Removed |Added

[Bug c++/103468] [modules] ICE Segmentation fault during GIMPLE pass walloca

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103468 Johel Ernesto Guerrero Peña changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resoluti

[Bug c++/103524] [meta-bug] modules issue

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524 Bug 103524 depends on bug 103468, which changed state. Bug 103468 Summary: [modules] ICE Segmentation fault during GIMPLE pass walloca https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103468 What|Removed |Added ---

[Bug c++/100583] [modules] ICE when importing

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100583 --- Comment #5 from Johel Ernesto Guerrero Peña --- This was fixed somewhere along the way.

[Bug c++/103468] [modules] ICE Segmentation fault during GIMPLE pass walloca

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103468 Johel Ernesto Guerrero Peña changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resol

[Bug c++/103524] [meta-bug] modules issue

2022-02-13 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524 Bug 103524 depends on bug 103468, which changed state. Bug 103468 Summary: [modules] ICE Segmentation fault during GIMPLE pass walloca https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103468 What|Removed |Added ---

[Bug c++/103118] New: [modules] ICE tree check in get_merge_kind at cp/module.cc

2021-11-07 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- Including `` in the following source results in an ICE

[Bug c++/103118] [modules] ICE tree check in get_merge_kind at cp/module.cc

2021-11-12 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118 --- Comment #1 from Johel Ernesto Guerrero Peña --- To work around this - Do not include ``. - Explicitly import a module that exports its definitions when you need to use the chrono library. I use the headers above to compile a header unit, wh

[Bug c++/103118] [modules] ICE tree check in get_merge_kind at cp/module.cc

2021-11-12 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118 --- Comment #2 from Johel Ernesto Guerrero Peña --- Or not. I forgot to uncomment uses of the chrono library.

[Bug c++/103118] [modules] ICE tree check in get_merge_kind at cp/module.cc

2021-11-12 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118 --- Comment #3 from Johel Ernesto Guerrero Peña --- What works is including them in a non-module unit translation unit. ```C++ #if defined(__GNUC__) and not defined(__clang__) # include // Workaround GCC bug 103118. # include// Workaroun

[Bug c++/100583] [modules] ICE when importing

2021-11-12 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100583 --- Comment #4 from Johel Ernesto Guerrero Peña --- As pointed out in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118#c3: > What works is including them in a non-module unit translation unit. > > ```C++ > #if defined(__GNUC__) and not defi

[Bug c++/103118] [modules] ICE tree check in get_merge_kind at cp/module.cc

2021-11-16 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118 --- Comment #4 from Johel Ernesto Guerrero Peña --- With the setup in Comment 3, now I can also include `` in the GMF of a module. I don't think this worked last week. Though all I'm doing in the module is specializing a my-library type trait on

[Bug c++/103339] New: [modules] ICE in exporting module on use of outside specialization

2021-11-19 Thread johelegp at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/onW6h5vej. mod.cpp: ```C++ export module mod; export template

[Bug c++/103341] New: ICE type of variable instantiation constrained on template parameter

2021-11-20 Thread johelegp at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/68GYeKqK4. ```C++ template struct is_same { }; template

[Bug c++/103339] [modules] ICE in exporting module on use of outside specialization

2021-11-23 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103339 --- Comment #1 from Johel Ernesto Guerrero Peña --- In non-reduced code, I got the error from Bug 99861 which I solved with the workaround above: ``` hash table checking failed: equal operator returns true for a pair of values with a different

[Bug c++/103339] [modules] ICE in exporting module on use of outside specialization

2021-11-23 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103339 --- Comment #2 from Johel Ernesto Guerrero Peña --- Or not really. Removing a comment breaks it again, so I guess the compiler is already in a bugged state that seems to work fine.

[Bug c++/103339] [modules] ICE in exporting module on use of outside specialization

2021-11-23 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103339 --- Comment #3 from Johel Ernesto Guerrero Peña --- Turns out that the error from Bug 99861 just happens occasionally when compiling.

[Bug c++/100687] [modules, concepts] imported concept gives different result

2021-11-24 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100687 Johel Ernesto Guerrero Peña changed: What|Removed |Added CC||johelegp at gmail dot com

[Bug c++/103468] New: [modules] ICE Segmentation fault during GIMPLE pass walloca

2021-11-29 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- my.std.headers.hpp: ```c++ #include #include

[Bug c++/99377] [modules] undefined std::string_view::empty() if referenced in inline exported function

2021-11-29 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99377 Johel Ernesto Guerrero Peña changed: What|Removed |Added CC||johelegp at gmail dot com

[Bug c++/99377] [modules] undefined std::string_view::empty() if referenced in inline exported function

2021-11-29 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99377 --- Comment #6 from Johel Ernesto Guerrero Peña --- A workaround for static member functions: ```C++ template [[nodiscard]] consteval I max() { return std::numeric_limits::max(); } if (v == std::numeric_limits::max()) break; if (v == max(

[Bug c++/103564] New: type-requirement that names a constructor should fail

2021-12-05 Thread johelegp at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/8dr9oG4Y1. ```C++ template concept C = requires

[Bug c++/99377] [modules] undefined std::string_view::empty() if referenced in inline exported function

2021-12-20 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99377 --- Comment #7 from Johel Ernesto Guerrero Peña --- if (v == [] consteval { return std::numeric_limits::max() }()) break; works too. More generally, you can avoid the linker error if you don't require the symbol at link time.

[Bug c++/86105] Conversion to ambiguous/inaccessible rvalue base is valid in unevaluated context

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86105 --- Comment #1 from Johel Ernesto Guerrero Peña --- Denoised: https://godbolt.org/z/87fbMG6f5. ```C++ template concept is_static_castable = requires(From && (*from)()) { static_cast(from()); }; struct B { }; struct D : B { }; struct D2 : D, B {

[Bug c++/99507] Can't return static address from immediate function

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99507 Johel Ernesto Guerrero Peña changed: What|Removed |Added Status|ASSIGNED|RESOLVED Known to wor

[Bug c++/99141] Name of deduced type unchecked in deduction guide

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99141 Johel Ernesto Guerrero Peña changed: What|Removed |Added Known to fail||11.0, 12.0 --- Comment #1

[Bug c++/95977] No deallocation of temporary in return-statement during constant evaluation

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95977 Johel Ernesto Guerrero Peña changed: What|Removed |Added Status|NEW |RESOLVED Known to wor

[Bug c++/96090] noexcept operator of potentially-throwing defaulted function gives the wrong result

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96090 Johel Ernesto Guerrero Peña changed: What|Removed |Added Known to fail||10.3.0, 11.2.0, 12.0

[Bug c++/95797] Can std::allocator.deallocate newed pointer during constant evaluation

2021-08-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95797 Johel Ernesto Guerrero Peña changed: What|Removed |Added Resolution|--- |FIXED Known to work|

[Bug c++/102137] New: class template argument deduction with template template parameter allows explicit deduction guide

2021-08-30 Thread johelegp at gmail dot com via Gcc-bugs
: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https

[Bug c++/102174] New: Unused result of undefined behavior arithmetic is accepted during constant evaluation

2021-09-02 Thread johelegp at gmail dot com via Gcc-bugs
Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z

[Bug c++/102191] New: Can't return prvalue with potentially-throwing destructor during constant evaluation

2021-09-03 Thread johelegp at gmail dot com via Gcc-bugs
IRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/8evP

[Bug c++/102220] New: Conversion from cv void* to object-type* not rejected during constant evaluation

2021-09-06 Thread johelegp at gmail dot com via Gcc-bugs
Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/ecYjGsWo7

[Bug c++/102249] New: Can't compare pointer to functions during constant evaluation

2021-09-08 Thread johelegp at gmail dot com via Gcc-bugs
valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- This is specified at https://eel.is/c++draft/expr.eq#3

[Bug c++/102258] New: dynamic_cast to derived type fails during constant evaluation

2021-09-09 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/dsEzaxW47. ```C++ struct B

[Bug c++/102258] dynamic_cast to derived type fails during constant evaluation

2021-09-09 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102258 --- Comment #1 from Johel Ernesto Guerrero Peña --- Workaround for my use-case: https://godbolt.org/z/5Woe8dvan. ```C++ #include #include #include #include #include struct B { virtual ~B() = default; }; struct D : B { int x{1}; constexpr ~D

[Bug c++/102258] dynamic_cast to derived type fails during constant evaluation

2021-09-09 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102258 --- Comment #2 from Johel Ernesto Guerrero Peña --- That still doesn't work because you can't compare (the addresses of) different `std::type_info` objects.

[Bug c++/102267] New: Can't compare pointers to instantiated variables during constant evaluation

2021-09-09 Thread johelegp at gmail dot com via Gcc-bugs
words: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- This is specified at https://eel.is/c++

[Bug c++/102267] Can't compare pointers to non-specialization instantiated variables during constant evaluation

2021-09-09 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102267 Johel Ernesto Guerrero Peña changed: What|Removed |Added Summary|Can't compare pointers to |Can't compare pointers to

[Bug c++/102284] New: Can access object outside of its lifetime during constant evaluation

2021-09-10 Thread johelegp at gmail dot com via Gcc-bugs
-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- This is prohibited at https://eel.is/c++draft

[Bug c++/102284] Can access object outside of its lifetime during constant evaluation

2021-09-10 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102284 --- Comment #1 from Johel Ernesto Guerrero Peña --- There's also https://eel.is/c++draft/basic.life#9.sentence-1 to consider. See https://godbolt.org/z/P97Kaqhv8. ```C++ struct X { int x; }; int main() { []() consteval { X x{}; x.~X();

[Bug c++/102284] Can access object outside of its lifetime during constant evaluation

2021-09-10 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102284 --- Comment #2 from Johel Ernesto Guerrero Peña --- Fixed that: https://godbolt.org/z/YGf4GTP5P. ```C++ struct X { constexpr ~X() { } }; int main() { []() consteval { X x{}; x.~X(); }(); } ```

[Bug c++/102267] Can't compare pointers to non-specialization instantiated variables during constant evaluation

2021-09-10 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102267 Johel Ernesto Guerrero Peña changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resoluti

[Bug c++/94716] comparison of address of template variables should be constexpr

2021-09-10 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94716 Johel Ernesto Guerrero Peña changed: What|Removed |Added CC||johelegp at gmail dot com

[Bug c++/102284] Can access object outside of its lifetime during constant evaluation

2021-09-10 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102284 --- Comment #4 from Johel Ernesto Guerrero Peña --- If there is, I confirmed it's not in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004.

[Bug c++/82877] negative array index accepted in a pointer difference expression in constexpr context

2021-09-12 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82877 Johel Ernesto Guerrero Peña changed: What|Removed |Added CC||johelegp at gmail dot com

[Bug c++/102420] New: null pointer dereference constant

2021-09-20 Thread johelegp at gmail dot com via Gcc-bugs
: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: ---

[Bug c++/102420] null pointer dereference during constant evaluation not rejected

2021-09-20 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102420 Johel Ernesto Guerrero Peña changed: What|Removed |Added Summary|null pointer dereference|null pointer dereference

[Bug c++/100583] [modules] ICE when importing

2021-09-26 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100583 --- Comment #1 from Johel Ernesto Guerrero Peña --- Please, add Bug 99227 to **Blocks:** for visibility.

[Bug c++/99227] [meta] [modules] Bugs relating to header-units of STL header files

2021-09-28 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99227 Johel Ernesto Guerrero Peña changed: What|Removed |Added CC||johelegp at gmail dot com

[Bug c++/102524] New: [modules] Missing diagnostic when an exported namespace is empty

2021-09-28 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- This is specified at [module.interface].3: > An expor

[Bug c++/102536] New: [modules] ICE Error reporting routines re-entered

2021-09-29 Thread johelegp at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/ehPzxqzWK. mod.cpp: ```C++ export module mod; namespace mod

[Bug c++/102576] New: [modules] Importing doesn't permit implicit uses

2021-10-03 Thread johelegp at gmail dot com via Gcc-bugs
valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- A use like ```C++ import; constexpr void test() { for (const

[Bug c++/102576] [modules] Importing doesn't permit implicit uses

2021-10-03 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102576 --- Comment #1 from Johel Ernesto Guerrero Peña --- `` is specified as including ``. It doesn't with with that either: ```C++ import; namespace { constexpr void test() { for (const int i : {0, 1, -1}) { } ``` ``` error: deducing from brace

[Bug c++/100583] [modules] ICE when importing

2021-10-03 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100583 --- Comment #3 from Johel Ernesto Guerrero Peña --- Thank you. > The solution is to use the include and remove the gcm file altogether. Is this still the case? I still get an ICE.

[Bug c++/102598] New: [modules] ICE in pp_string, at pretty-print.c

2021-10-04 Thread johelegp at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/3rGTTr6jE. write.cpp: ```C++ export module write; export void

[Bug c++/102598] [modules] ICE in pp_string, at pretty-print.c

2021-10-04 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102598 --- Comment #1 from Johel Ernesto Guerrero Peña --- Attempts to reduce another wrong-code bug lead to this.

[Bug c++/102600] New: [modules] ICE Segmentation fault during GIMPLE pass evrp

2021-10-04 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- main.cpp: ```C++ import; void push(std::byte) {} void write

[Bug c++/102607] New: [modules] option -g results in undefined reference to `typeinfo for type`

2021-10-05 Thread johelegp at gmail dot com via Gcc-bugs
: link-failure Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/qP6EPWhEz. mod.cpp

[Bug c++/102607] [modules] option -g results in undefined reference to `typeinfo for type`

2021-10-05 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102607 --- Comment #1 from Johel Ernesto Guerrero Peña --- A workaround is to define `B`'s destructor as `constexpr virtual ~B() { }`.

[Bug c++/102600] [modules] ICE Segmentation fault during GIMPLE pass evrp

2021-10-06 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102600 --- Comment #2 from Johel Ernesto Guerrero Peña --- A workaround: ```C++ export using byte = // Workaround GCC bug 102600. #if not defined(NDEBUG) or (defined(__clang__) or not defined(__GNUC__)) std::byte; #else unsigned char; #endif ```

[Bug c++/102931] New: ICE explicit lambda call operator without template keyword

2021-10-25 Thread johelegp at gmail dot com via Gcc-bugs
-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/8GGoqr9z3. ```C++ template

[Bug c++/102933] New: Can't use CTAD in template argument

2021-10-25 Thread johelegp at gmail dot com via Gcc-bugs
ority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/P8xq8h9M1. ```C++ template struct X { T t; }; template void f(); template

[Bug c++/102963] New: [modules] ICE failed static_assert of concept

2021-10-27 Thread johelegp at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/7h1MPqe1h. mod.cpp: ```C++ export module mod; export template concept C = false; ``` test.cpp: ```C

[Bug c++/102963] [modules] ICE failed static_assert of concept

2021-10-27 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102963 --- Comment #1 from Johel Ernesto Guerrero Peña --- As per the logic in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99631#c1, this isn't marked with any of the ice-* keywords.

[Bug c++/102975] New: Local alias diagnosed as unused when used in failing constraint

2021-10-27 Thread johelegp at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/aePcW8WjK. ```C++ template concept

[Bug c++/102975] Local alias diagnosed as unused when used in failing constraint

2021-10-31 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102975 --- Comment #4 from Johel Ernesto Guerrero Peña --- I'm fine with closing this as RESOLVED INVALID or something along those lines.

[Bug libstdc++/107378] New: `get_if` implementation "is not a constant expression"

2022-10-24 Thread johelegp at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/cf1T7q6Tj. ```C++ #include static_asser

[Bug c++/107378] `get_if` implementation "is not a constant expression"

2022-10-24 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107378 --- Comment #3 from Johel Ernesto Guerrero Peña --- MSVC accepts https://godbolt.org/z/nheYz9aez. ```C++ static_assert([i = 0] { return &i != nullptr; }()); ``` ``` : In lambda function: :1:35: warning: the address of 'i' will never be NULL [-

[Bug c++/106363] [13 Regression] [modules] Can't selectively reexport imported declaration in same namespace

2022-10-24 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106363 Johel Ernesto Guerrero Peña changed: What|Removed |Added Summary|[modules] Can't selectively |[13 Regression] [modules]

[Bug c++/106363] [13 Regression] [modules] ICE using-declaration of imported name in the same namespace

2022-10-24 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106363 Johel Ernesto Guerrero Peña changed: What|Removed |Added Known to work||12.2.0 Known to fail

[Bug c++/107378] `get_if` implementation "is not a constant expression"

2022-10-24 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107378 --- Comment #5 from Johel Ernesto Guerrero Peña --- I think so. My actual use case looks like `constexpr auto v = E;` at global scope, where `E` creates a temporary with a subobject of `std::variant`. Wrapping `E` in an IILE is a workaround for

[Bug c++/107938] New: ICE directly returning `this` of `extern` variable in template

2022-11-30 Thread johelegp at gmail dot com via Gcc-bugs
-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://compiler-explorer.com/z/4d1esaber. ```C

[Bug c++/107939] New: Rejects use of `extern const` variable in a template

2022-11-30 Thread johelegp at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://compiler-explorer.com/z/q3a7e7s1e. Changing `#if 1` to `#if 0` works, so this

[Bug c++/107939] [11/12/13 Regression] Rejects use of `extern const` variable in a template

2022-11-30 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107939 --- Comment #2 from Johel Ernesto Guerrero Peña --- Making the expression using the `extern const` variable more complex or indirect makes it work. With an IILE, for example: https://compiler-explorer.com/z/EjYYvPvqT.

[Bug c++/108169] class type template parameters are const in GCC (differs from other compilers)

2022-12-26 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108169 Johel Ernesto Guerrero Peña changed: What|Removed |Added CC||johelegp at gmail dot com

[Bug c++/105743] New: Bogus unused but set lambda warning

2022-05-26 Thread johelegp at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/xq16xac15. ```C++ void f(auto x) { x(0); } void g() { static constexpr auto h

[Bug c++/105743] Bogus unused but set lambda warning

2022-05-26 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105743 Johel Ernesto Guerrero Peña changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resoluti

<    1   2   3   >