https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864
--- Comment #5 from mgsergio ---
And what about the inconsistency with compilation error on
int main() {
int b{2.3};
}
In that case an error is generated.
And if I use
template
inline T narrowing_check(U const u)
{
return {u};
}
I get a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864
--- Comment #1 from mgsergio ---
*gcc emits a warning on narrowing_check although an error should be generated
instead.
: unassigned at gcc dot gnu.org
Reporter: mgsergio at yandex dot ru
Target Milestone: ---
#include
#include
using namespace std;
template
inline T narrowing_check(U const u)
{
// Also gives only warning
// T t{u};
// return t;
return {u};
}
int main() {
auto a