[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #10 from Jonathan Wakely --- EDG rejects it too: "loop.cc", line 11: warning: "auto Magic(utempl::loopholes::Getter)" declares a non-template function -- add <> to refer to a template instance friend constexp

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #9 from Jonathan Wakely --- Without the library dependency: struct _ignore { template constexpr const _ignore& operator=(const T&) const { return *this; } }; constexpr _ignore ignore{}; namespace utempl::loopholes { template s

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread linuxnyasha at tutanota dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 linuxnyasha at tutanota dot com changed: What|Removed |Added Resolution|--- |INVALID St

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #7 from Andrew Pinski --- (In reply to linuxnyasha from comment #6) > (In reply to Andrew Pinski from comment #5) > > (In reply to linuxnyasha from comment #2) > > > On clang works > > > > But 2 out of 3 compilers have the same erro

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread linuxnyasha at tutanota dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #6 from linuxnyasha at tutanota dot com --- (In reply to Andrew Pinski from comment #5) > (In reply to linuxnyasha from comment #2) > > On clang works > > But 2 out of 3 compilers have the same error message which might mean this > i

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #5 from Andrew Pinski --- (In reply to linuxnyasha from comment #2) > On clang works But 2 out of 3 compilers have the same error message which might mean this is not valid code. with and without optimizations in GCC in this case us

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread linuxnyasha at tutanota dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #4 from linuxnyasha at tutanota dot com --- (In reply to Andrew Pinski from comment #1) > MSVC rejects this code: > ``` > (46): error C3779: 'utempl::loopholes::Magic': a function that > returns 'auto' cannot be used before it is defi

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread linuxnyasha at tutanota dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #3 from linuxnyasha at tutanota dot com --- (In reply to Andrew Pinski from comment #1) > MSVC rejects this code: > ``` > (46): error C3779: 'utempl::loopholes::Magic': a function that > returns 'auto' cannot be used before it is defi

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread linuxnyasha at tutanota dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #2 from linuxnyasha at tutanota dot com --- (In reply to Andrew Pinski from comment #1) > MSVC rejects this code: > ``` > (46): error C3779: 'utempl::loopholes::Magic': a function that > returns 'auto' cannot be used before it is defi

[Bug c++/115808] Different behavior with optimizations enabled and disabled.

2024-07-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808 --- Comment #1 from Andrew Pinski --- MSVC rejects this code: ``` (46): error C3779: 'utempl::loopholes::Magic': a function that returns 'auto' cannot be used before it is defined (6): note: see declaration of 'utempl::loopholes::Magic' (46): er