[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-26 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #17 from Gwen Fu --- Created attachment 60895 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60895&action=edit Other cases of this conversion, including assignment and some other use cases Initialization and assignment

[Bug c++/80681] missing -Wuninitialized for const or reference member of a private base class

2025-03-26 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80681 Gwen Fu changed: What|Removed |Added CC||gwen3293940943 at gmail dot com --- Comment #6

[Bug translation/90179] typo in diagnostic for unrecognized control register

2025-03-26 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90179 Gwen Fu changed: What|Removed |Added CC||gwen3293940943 at gmail dot com --- Comment #1

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-24 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #16 from Gwen Fu --- I am void under the gcc/c-family/c-warn.cc file warnings_for_convert_and_check (location_t loc, tree type, tree expr, tree result) function performs the following judgment and processing: /*"inifity to int" thi

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-17 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #14 from Gwen Fu --- and I will send the patch at the same time

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-17 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #13 from Gwen Fu --- When executing the conversion_warning function, if you do not add any of the three compilation options -Warn-conversion or -Warn_sign_conversion or -Warn-float-conversion, the function will return directly.

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-16 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #12 from Gwen Fu --- I know how this bug generate this time (100%)! This is because the funx conversion_warning (in c-family/c-warn.cc , the helper function for warnings_for_convert_and_check)lacks some checks when expr is of type do

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-15 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #11 from Gwen Fu --- E , This is a bit complicated. But I think the problem must occur in the grammatical analysis or semantic analysis stage I would like to know in which file should the code for floating point (real number) typ

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-15 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #9 from Gwen Fu --- I am sorry for my recklessness and carelessness! And thank you for your patient guidance. In gcc/convert.cc : func:convert_to_integer_1 : the case : case REAL_TYPE: if (sanitize_flags_p (SANITIZE_FLOAT_

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-15 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #6 from Gwen Fu --- And also see "constexpr.cc in "gcc/cp": the function "potential_constant_expression_1": if (integer_zerop (denom)) { if (flags & tf_error) constexpr_error (input_locatio

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-14 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #5 from Gwen Fu --- Maybe the bug is related to the code below: (in gcc/fold-const.cc :fold_binary_loc) case RDIV_EXPR: /* Don't touch a floating-point divide by zero unless the mode of the constant can represent i

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-12 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 --- Comment #3 from Gwen Fu --- (In reply to Antony Polukhin from comment #0) > Consider the following example: > > int foo() { > return 1 / static_cast(0); > } > > > With -Wall -Wextra there is no warning about an undefined behavior > ([

[Bug c++/119222] Conversion of inf to integer is not diagnosed

2025-03-12 Thread gwen3293940943 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222 Gwen Fu changed: What|Removed |Added CC||gwen3293940943 at gmail dot com --- Comment #