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

linuxnyasha at tutanota dot com gcc-bugzilla@gcc.gnu.org
Sat Jul 6 23:56:46 GMT 2024


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:
> ```
> <source>(46): error C3779: 'utempl::loopholes::Magic': a function that
> returns 'auto' cannot be used before it is defined
> <source>(6): note: see declaration of 'utempl::loopholes::Magic'
> <source>(46): error C2062: type 'unknown-type' unexpected
> 
> ```
> 
> 
> So I am suspecting this might be not valid code but no diagnostic required.

On clang works


More information about the Gcc-bugs mailing list