[Bug c++/102916] cmath constexpr can lead to ODR violations/incorrect results

2021-10-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102916 --- Comment #5 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > (In reply to Darrell Wright from comment #3) > > Also http://eel.is/c++draft/library#constexpr.functions-1 > > > > An issue is that it's high level observable a

[Bug c++/102916] cmath constexpr can lead to ODR violations/incorrect results

2021-10-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102916 --- Comment #4 from Andrew Pinski --- (In reply to Darrell Wright from comment #3) > Also http://eel.is/c++draft/library#constexpr.functions-1 > > An issue is that it's high level observable and not just an optimization http://www.open-std.org

[Bug c++/102916] cmath constexpr can lead to ODR violations/incorrect results

2021-10-24 Thread Darrell.Wright at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102916 --- Comment #3 from Darrell Wright --- Also http://eel.is/c++draft/library#constexpr.functions-1 An issue is that it's high level observable and not just an optimization

[Bug c++/102916] cmath constexpr can lead to ODR violations/incorrect results

2021-10-24 Thread Darrell.Wright at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102916 --- Comment #2 from Darrell Wright --- The constexpr value returned is different depending on the compiler. If one uses clang and gcc this leads to an ODR issue as void bar( ) { if constexpr( foo<[]{ return std::sqrt( 4.0 ); }>( ) ) { d

[Bug c++/102916] cmath constexpr can lead to ODR violations/incorrect results

2021-10-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102916 --- Comment #1 from Andrew Pinski --- > this can lead to ODR issues I don't think it can the C++ standard allows a compiler to have an extended const expressions IIRC.