[Bug c/94053] New: Segmentation fault in default Optimization, but works well in O1 ~ Os

2020-03-05 Thread haoxintu at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, The code test.c #include #include void foo(int* a ) { a[-1]=1; } int main (int argc, char* argv[]) { int size= 10

[Bug c/94055] New: Segmentation fault in memet function

2020-03-05 Thread haoxintu at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, this code test.c #include #include #include int main (int argc, char* argv[]) { int size = 1000; printf("%d \n", size); int array[size]; memset(ar

[Bug c/94055] Segmentation fault in memet function

2020-03-05 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94055 --- Comment #3 from Haoxin Tu --- I see. Thank you for your responding. Have a good day!

[Bug c/93849] New: 'Segmentation fault' in the special index for an array

2020-02-20 Thread haoxintu at gmail dot com
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, I am developing a random c generation tool to find c compiler bugs. I found an interesting code that compiles successfully but get a "Segmentation fault" r

[Bug c/93850] New: 'stack smashing detected' in the special index for an array

2020-02-20 Thread haoxintu at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, I am developing a random c generation tool to find c compiler bugs. I found an interesting code that compiles successfully but get a "

[Bug c/94686] New: internal compiler error: in gimplify_expr

2020-04-21 Thread haoxintu at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, the test.c (reduced by C-Reduce) #include int a = 0,b = 0; int main(){ int c = (int)(long)(b * 0 >= a & b * 0 >= a); return 0; } $gcc-6 test.c then got the

[Bug c/94322] New: Detected memory leaks while using clang AddressSanitizer to build GCC

2020-03-25 Thread haoxintu at gmail dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, I use clang with AddressSanitizer and detected memory leaks while building GCC. The SUMMARY

[Bug c++/91867] Internal compiler error in simple for(auto) loop when using -std=c++11 with -fconcepts

2020-05-23 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91867 Haoxin Tu changed: What|Removed |Added CC||haoxintu at gmail dot com --- Comment #4

[Bug c++/96623] New: [10/11 Regression] ICE in inject_parm_decls, at cp/parser.c:23893

2020-08-14 Thread haoxintu at gmail dot com
-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Input: //small.cc struct A{ void a(){ struct B { void b () noexcept

[Bug c++/95354] GCC misuse "nonnull-attribute" option and can not detect it as UB as well

2020-05-27 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95354 --- Comment #5 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #4) > (In reply to Haoxin Tu from comment #3) > > I see. Are there any cases that can trigger the UB of nonnull-attribute? I > > doubt the usage of

[Bug c++/95334] New: GCC detect missing signed-integer-overflow when add "const"

2020-05-26 Thread haoxintu at gmail dot com
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code test1.cc #include #include wchar_t g_wchar = 0; int g_int = -1975564288; int l_int = -1227761344; int main () {

[Bug middle-end/95326] GCC can not detect signed-integer-overflow correctly

2020-05-26 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95326 --- Comment #3 from Haoxin Tu --- Would GCC shorten the multiple to be other types early as well? I also find some cases in "short" type with the same symptom. I am still testing now and don't know there are any cases in rest of types(such as

[Bug c++/95326] New: UBsan can not detect signed-integer-overflow correctly

2020-05-25 Thread haoxintu at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This case example.cpp #include volatile wchar_t g_volatile_wchar = 2082494266; volatile unsigned short g_volatile_ushort = 31503U; int main () { unsigned long

[Bug c++/95326] GCC can not detect signed-integer-overflow correctly

2020-05-25 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95326 Haoxin Tu changed: What|Removed |Added Version|11.0|10.0 --- Comment #1 from Haoxin Tu --- I

[Bug c++/95385] New: GCC stop detect UBs after a divide by zero in for statement

2020-05-28 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code test1.cc #include int main () { int a = 1; for (int i = 0; i < 10; ++i) { a /= i; // Error: division by z

[Bug c++/95385] GCC stop detect UBs after a divide by zero in for statement

2020-05-29 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95385 --- Comment #3 from Haoxin Tu --- (In reply to Richard Biener from comment #2) > We likely eliminate the dead 0/0 and 0/b instructions but fail for the one in > the loop at -O0. As soon as the actual instruction is carried out the > program

[Bug sanitizer/95430] New: [UBSAN] doesn't detect out of bounds in a simple case

2020-05-29 Thread haoxintu at gmail dot com
Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org Target Milestone

[Bug c++/95461] New: GCC misses -Warray-bounds warning message

2020-06-01 Thread haoxintu at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This case test.cc #include int main () { int a[10] = {0}; a[11] = 0; std::cout << "ok" << std::endl; return 0; } produce nothing in gcc-t

[Bug sanitizer/95385] GCC stop detect UBs after a divide by zero in for statement

2020-06-01 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95385 --- Comment #4 from Haoxin Tu --- (In reply to Haoxin Tu from comment #3) Hi, so sorry to bother you. Is still there any problem here? Please take a look at test3.cc and test4.cc. Thank you so much.

[Bug c++/95473] New: GCC misses -Wnull-dereference warning in a simple code

2020-06-01 Thread haoxintu at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- $cat null_ref.cc int main(){ int = *(int *)nullptr; // null reference return 0; } GCC can not catch any warning when I use -Wnull-dereference option. I also

[Bug c++/95475] Imprecise column number of runtime error in unreachable program point

2020-06-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95475 --- Comment #2 from Haoxin Tu --- (In reply to Andrew Pinski from comment #1) > The question is where should it be, at the open of the () or the start of > the identifier __builtin_unreachable ? In C++, it is the open. In C, it is > the start.

[Bug c++/95475] New: Imprecise column number of runtime error in unreachable program point

2020-06-02 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- $cat test.cc int main(){ int var = 2; switch (var) { case 1: default

[Bug c++/95334] GCC detect missing signed-integer-overflow when add "const"

2020-05-26 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95334 --- Comment #2 from Haoxin Tu --- I also find these cases test1.cc #include bool g_bool = 0; long g_long = -4075183478711827874L; const long l_long = 7122990940771016367L; int main () { g_bool = g_long * l_long; std::cout << g_bool <<

[Bug c++/95354] New: GCC misuse "nonnull-attribute" option and can not detect it as UB as well

2020-05-26 Thread haoxintu at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This case test.cc #include #include void has_nonnull_argument(__attribute__((nonnull)) int *p) { ;

[Bug c++/95354] GCC misuse "nonnull-attribute" option and can not detect it as UB as well

2020-05-27 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95354 --- Comment #3 from Haoxin Tu --- I see. Are there any cases that can trigger the UB of nonnull-attribute? I doubt the usage of “-fsanitize=nonnull-attribute” in GCC...

[Bug c++/96437] New: [10/11 Regression] ICE in tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in synthesize_implicit_template_parm, at cp/parser.c:44246

2020-08-03 Thread haoxintu at gmail dot com
Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, reduced by C-Vise, makes GCC-trunk ICE, while GCC-10 and downwards versions behave well in error-recovery. Input: //small.cc template <()> void A(auto){} Command: g++ small.cc Output: small.cc:1:11: error: ex

[Bug c++/96440] New: ICE in tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:841

2020-08-03 Thread haoxintu at gmail dot com
Keywords: error-recovery, ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, reduced by C-Vise, makes GCC

[Bug c++/96438] New: [10/11 Regression] ICE in do_pushtag, at cp/name-lookup.c:6861

2020-08-03 Thread haoxintu at gmail dot com
, ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, reduced by C-Vise, makes GCC-trunk ICE, while GCC-10

[Bug c++/96441] New: ICE in tree check: expected integer_cst, have cond_expr in get_len, at tree.h:5954

2020-08-03 Thread haoxintu at gmail dot com
Keywords: error-recovery, ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, reduced by C-Vise, makes GCC-trunk ICE

[Bug c++/96442] New: ICE in tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have record_type in int_fits_type_p, at tree.c:8954

2020-08-03 Thread haoxintu at gmail dot com
: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, reduced by C-Vise, makes GCC-trunk ICE and makes released GCC versions "confused by early errors". Input: //small.cc enum struct a : struct {}; template enum class a : class c{}; enum struct a {b}; Command: g+

[Bug c++/96477] New: GCC accepts attribute 'const' as an attribute pack

2020-08-04 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. Following code might be a invalid code? GCC accepts it while Clang or ICC rejects it. Code: [[gnu::const ... ]] int foo

[Bug c++/96478] New: GCC accepts enum definition in alignas()

2020-08-04 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code might be a invalid code, but GCC accepts it well. Other mainstream compilers reject this code. Code: namespace { template

[Bug c++/96553] New: ICE in unexpected expression ‘__alignof__ (auto:1)’ of kind alignof_expr

2020-08-10 Thread haoxintu at gmail dot com
-recovery, ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, reduced by C-Vise, makes GCC-trunk ICE and released

[Bug c++/96552] New: GCC accepts "alignas(auto)" in function parameter list

2020-08-10 Thread haoxintu at gmail dot com
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. Following code is invalid I think, the "alignas" shouldn't be in function parameter. I guess GC

[Bug c++/96465] New: ICE in tsubst_function_decl, at cp/pt.c:13669

2020-08-04 Thread haoxintu at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, similar with bug 96464 code, makes GCC-7.1 onwards versions ICE or "confused by earlier e

[Bug c++/96462] [10/11 Regression] ICE in tree check: expected identifier_node, have bit_not_expr in find_namespace_slot, at cp/name-lookup.c:97

2020-08-04 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96462 --- Comment #2 from Haoxin Tu --- (In reply to Marek Polacek from comment #1) > Confirmed. Hi, Marek. Thanks for your quick response! Best, Haoxin

[Bug c++/96464] New: GCC allows 'auto' in template argument

2020-08-04 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code is invalid code I guess, but GCC-6.0 onwards versions accept it. $cat small.cc template class b {}; void foo(){ auto var

[Bug c++/96467] New: [8/9/10/11 Regression] in finish_member_declaration, at cp/semantics.c:3240

2020-08-04 Thread haoxintu at gmail dot com
-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code makes GCC-9.1 onwards versions ICE without any error messages. I

[Bug c++/96462] New: [10/11 Regression] ICE in tree check: expected identifier_node, have bit_not_expr in find_namespace_slot, at cp/name-lookup.c:97

2020-08-04 Thread haoxintu at gmail dot com
Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all

[Bug c++/96110] New: Function declarator with a trailing return type "auto" should be allowed in try-catch block

2020-07-08 Thread haoxintu at gmail dot com
NCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. The code test.cc int main(){ try {} catch

[Bug c++/96097] ICE in dependent_type_p, at cp/pt.c:26326

2020-07-08 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96097 Haoxin Tu changed: What|Removed |Added CC||haoxintu at gmail dot com --- Comment #3

[Bug c++/95972] ICE in check_member_template, at cp/decl2.c:570

2020-07-08 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95972 --- Comment #2 from Haoxin Tu --- Update a new case. Input: int a() { [] ( auto class {int b()}} Output: : In function 'int a()': :1:27: error: types may not be defined in parameter types 1 | int a() { [] ( auto class {int b()}} |

[Bug c++/96137] New: [11 Regression] GCC hang on in invalid function definition

2020-07-09 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This simple code makes GCC-trunk hang on. The memory seems ok, only with endless compiling. $cat bug.cc void a () { .operator b } $g

[Bug c++/96137] [11 Regression] GCC hang on in invalid function definition

2020-07-09 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96137 --- Comment #1 from Haoxin Tu --- Also, I want to know are those cases (invalid code but makes GCC hang on) worth reporting? If those cases can help improve the GCC FE or its performance, I will continue to file more reports. Otherwise, I will

[Bug c++/96116] New: GCC accepts "enum struct/class" in reference to enumeration

2020-07-08 Thread haoxintu at gmail dot com
ts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi,all. This code, might be an invalid code, but GCC accepts it. $cat test.cc using alias1 = e

[Bug c++/96118] New: GCC accepts invalid combination of two type specifiers

2020-07-08 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, combines a typedef specifier and a normal type specifier, might be an invalid code. $cat test.cc typedef long

[Bug c++/96119] New: GCC accepts invalid qualifier in a try-catch block

2020-07-08 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code might be an invalid code, but GCC accepts this well. $cat test.cc int main(){ try {} catch (int

[Bug c++/96120] Ambiguity diagnostic message of "invalid use of type 'void' in parameter declaration"

2020-07-08 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96120 --- Comment #3 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #1) > (In reply to Haoxin Tu from comment #0) > > GCC might emit the ambiguity diagnostic message on it. > > What does that mean? Apologize for my expression. I mean

[Bug c++/96110] Function declarator with a trailing return type "auto" should be allowed in try-catch block

2020-07-08 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96110 --- Comment #5 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #2) > This isn't specific to catch handlers, other compilers accept that nonsense > function declaration in various contexts, and GCC rejects them all: Thanks for your

[Bug c++/95972] ICE in check_member_template, at cp/decl2.c:570

2020-07-08 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95972 --- Comment #4 from Haoxin Tu --- (In reply to Marek Polacek from comment #3) > You can still use creduce (I do), but it's good to try adding missing > parens/braces and similar to make the code more sensible. Yes, you are right. Thanks for

[Bug c++/96120] New: Ambiguity diagnostic message of "invalid use of type 'void' in parameter declaration"

2020-07-08 Thread haoxintu at gmail dot com
NCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, test.cc, GCC might emit the ambiguity diagnost

[Bug c++/96137] [11 Regression] GCC hang on in invalid function definition

2020-07-09 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96137 --- Comment #3 from Haoxin Tu --- (In reply to Marek Polacek from comment #2) > I would treat them just like ICEs. They are useful if the testcase isn't > complete garbage. This one is sort of useful because it shows that my > change above

[Bug c++/96077] GCC accepts ill-legal local enum definition

2020-07-06 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96077 --- Comment #2 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #1) > It's not ideal to provide a testcase that doesn't compile for an > accepts-invalid bug. A testcase that actually compiles is a better > demonstration that the

[Bug c++/96082] New: GCC rejects the template disambiguator with "typename"

2020-07-06 Thread haoxintu at gmail dot com
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, test.cc, GCC rejects it in versions from 9.1 to trunk, but accepts it from 8.3 to 4.8 versions. $c

[Bug c++/96145] New: Weird output in compiling a typedef union as a function return type

2020-07-10 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, test.cc, uses a typedef name of a union as a return type of a function, the GCC compiled output might be weird

[Bug c++/96182] New: GCC accepts constexpr function with no return-statement

2020-07-13 Thread haoxintu at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi,all. This code, test.cc, is an invalid code I guess, but GCC accepts it. $cat test.cc constexpr int foo

[Bug c++/96183] New: GCC accepts "convert '' from 'void' to 'int'" at compile time

2020-07-13 Thread haoxintu at gmail dot com
ts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi,all. This code, test.cc, is an invalid code but GCC accepts it. $cat test.cc void foo

[Bug c++/96182] GCC accepts constexpr function with no return-statement

2020-07-13 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96182 --- Comment #2 from Haoxin Tu --- (In reply to Jakub Jelinek from comment #1) > The difference is that in C++11 the standard requires that the body of a > constexpr function is return expression, that is not the case of C++14 > anymore. > And,

[Bug c++/96184] New: GCC treats "use of local variable with automatic storage from containing function" differently in versions

2020-07-13 Thread haoxintu at gmail dot com
sion: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, GCC-trunk and other versions (etc., GCC

[Bug c++/96162] [11 Regression] ICE in discriminator_for_local_entity, at cp/mangle.c:1910

2020-07-14 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96162 --- Comment #1 from Haoxin Tu --- Add a more case. $cat p.cc #include int a() { for (static int & b) {} } $g++ p.cc test.cc: In function ‘int a()’: test.cc:3:24: error: expected ‘;’ before ‘)’ token 3 | for (static int & b) {}

[Bug c++/96210] New: Diagnostic message for using-directive in template definition should be more clear?

2020-07-15 Thread haoxintu at gmail dot com
Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. Alias template is allowed since c++11 while using-directive

[Bug c++/96207] New: GCC accepts "delete" function definition inside a class member function

2020-07-15 Thread haoxintu at gmail dot com
s: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, test.cc, is an invalid code, GCC compiles it well, while other

[Bug c++/96209] New: Redundant error message split out when adding "typename" keyword

2020-07-15 Thread haoxintu at gmail dot com
diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, test1.cc and test2.cc ( they are in the same meaning I guess), are in

[Bug c++/96057] New: -Wreturn-type warning message disappears with -O1 to -Os in unnamed namespace definition

2020-07-04 Thread haoxintu at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This small code, bug.cc, the -Wreturn-type warning disappears when add -O1 or higher optimization option

[Bug c++/95945] ICE in poplevel, at cp/decl.c:585

2020-07-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95945 --- Comment #1 from Haoxin Tu --- Add a more meaningful case $cat p.cc int a ( auto struct x { int b ();}) {} $g++ -w p.cc p.cc:1:23: error: types may not be defined in parameter types 1 | int a ( auto struct x { int b ();}) {} |

[Bug c++/95927] ICE in cp_lexer_new_from_tokens, at cp/parser.c:701

2020-07-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95927 --- Comment #1 from Haoxin Tu --- Add a more meaningful case. $cat p.cc template struct a {}; class A { struct a < struct x { void b ( ){}} >; }; $g++ p.cc p.cc:3:25: error: types may not be defined in template arguments 3 |

[Bug c++/95956] ICE in check_bases, at cp/class.c:1689

2020-07-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95956 W E Brown changed: What|Removed |Added CC||webrown.cpp at gmail dot com --- Comment #1

[Bug c++/95972] ICE in check_member_template, at cp/decl2.c:570

2020-07-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95972 --- Comment #1 from Haoxin Tu --- Hi, there. I guess I shouldn't use C-Reduce to reduce my ICE on invalid code cases. After using C-Reduce, the cases are more like a "garbage" code. Here is a more readable code to reproduce the ICE. $cat p.cc

[Bug c++/95955] ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952

2020-07-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95955 W E Brown changed: What|Removed |Added CC||webrown.cpp at gmail dot com --- Comment #1

[Bug c++/95931] ICE in dependent_type_p, at cp/pt.c:26326

2020-07-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95931 --- Comment #1 from Haoxin Tu --- Add a more meaningful case. $cat p.cc void a() { auto var = [] (auto, volatile b) {}; } $g++ p.cc p.cc: In function ‘void a()’: p.cc:2:35: error: ‘b’ does not name a type 2 | auto var = [] (auto,

[Bug c++/95932] ICE in redeclare_class_template, at cp/pt.c:6231

2020-07-02 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95932 --- Comment #1 from Haoxin Tu --- Add a more meaningful case. $cat p.cc template class a {}; template > struct a < class b{}, struct b {}>; $g++ p.cc p.cc:2:28: error: expected ‘class’ or ‘typename’ before ‘>’ token 2 | template >

[Bug c++/96045] New: Wrong line and column diagnostic message in a class template instantiation

2020-07-03 Thread haoxintu at gmail dot com
: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This simple code, bug.cc, GCC-trunk can not emit the right diagnostic information. $cat bug.cc

[Bug c++/96068] New: Extra semicolon outside of a function should be allowed after c++11?

2020-07-05 Thread haoxintu at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. As the summary, extra ";" should be allowed in GCC after -std=c++11 and shou

[Bug c++/96048] New: ICE in get_local_decls, at cp/name-lookup.c:3591

2020-07-03 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This invalid code, bug.cc, makes GCC-trunk ICE. $cat bug.cc struct a {template class A;}; a : b ( auto ) ( class { }); $g++ -c -w

[Bug c++/96162] New: [11 Regression] ICE in discriminator_for_local_entity, at cp/mangle.c:1910

2020-07-10 Thread haoxintu at gmail dot com
: error-recovery, ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, test.cc, is an invalid code, makes GCC-trunk ICE

[Bug c++/96077] New: GCC accepts ill-legal local enum definition

2020-07-06 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, test.cc, has a grammar issue in "missing ')'", but GCC accepts it well. $cat test.cc enum { a = ( 1 ) ? ( 2 )

[Bug c++/96103] New: Unclear diagnostic for a function return with "decltype(auto)"

2020-07-07 Thread haoxintu at gmail dot com
diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This code, "decltype(auto)" in return type is a c++14 extension and I gues

[Bug c++/95742] New: Bad error message in parsing a function with "decltype()"

2020-06-18 Thread haoxintu at gmail dot com
diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: redi at gcc dot gnu.org Target Milestone: --- This code test.cc, I think it's not a garbage inp

[Bug c++/95725] New: Confusing error diagnostic in an invalid template

2020-06-17 Thread haoxintu at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code test.cc, makes GCC get confused while parsing. $cat test.cc template ’ before ‘;’ token test.cc:1:22: error: expected unqualified-id before ‘;’ token $g++-10 -w

[Bug c++/95724] bogue error : "expected '{' before ')' token"

2020-06-17 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95724 --- Comment #2 from Haoxin Tu --- (In reply to Martin Liška from comment #1) > For the next time, can you please add 'ice-on-invalid-code' keyword? I got it. So sorry for my mistake!

[Bug c++/95724] New: bogue error : "expected '{' before ')' token"

2020-06-17 Thread haoxintu at gmail dot com
mponent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code test.cc, GCC-trunk get a bogus error message and then get confused with following code parsing. $cat test.cc template <(union : decltype(a = 0)>)

[Bug c++/95725] Confusing error diagnostic in an invalid template

2020-06-17 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95725 --- Comment #2 from Haoxin Tu --- (In reply to Martin Liška from comment #1) > For the next time, can you please add 'ice-on-invalid-code' keyword? Ok, so sorry it's my fault. But this is a diagnostic issue I think? I will add "diagnostic"

[Bug c++/95723] New: GCC get confused while parsing a code

2020-06-17 Thread haoxintu at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code test.cc, GCC might get confused in parsing. $cat test.cc template friend foo ( decltype (b=c $g++-trunk -w test.cc test.cc:1:12: error: ‘a’ has not been declared 1

[Bug c++/95744] New: Duplicate error message in a simple decltype specifier

2020-06-18 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: mpolacek at gcc dot gnu.org, redi at gcc dot gnu.org Target Milestone: --- The test.cc includes a very simple valid decltype specifier

[Bug c++/95831] New: Wrong line number in " -Wconversion" warning message

2020-06-22 Thread haoxintu at gmail dot com
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: mpolacek at gcc dot gnu.org Target Milestone: --- This code, bug.cc, GCC might emit the wrong line number of the "-Wconversion&

[Bug c++/95872] New: Duplicated warning message in "-Wlogical-op"

2020-06-24 Thread haoxintu at gmail dot com
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: mpolacek at gcc dot gnu.org Target Milestone: --- This code, bug.cc, GCC emits two duplicated warning messages about it. $cat bug.cc

[Bug c++/95873] New: Duplicated warning message "'class' tag used in naming 'union a'"

2020-06-24 Thread haoxintu at gmail dot com
diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: mpolacek at gcc dot gnu.org Target Milestone: --- This code, bug.cc, GCC emits two duplicat

[Bug c++/95871] New: Duplicated error message : "the value is not usable in a constant expression"

2020-06-24 Thread haoxintu at gmail dot com
Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: mpolacek at gcc dot gnu.org Target Milestone: --- This code, bug.cc, GCC emits two

[Bug c++/95875] New: Misleading error message "invalid use of incomplete type"

2020-06-24 Thread haoxintu at gmail dot com
diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com CC: mpolacek at gcc dot gnu.org Target Milestone: --- $cat bug.cc class A: public A, A, A {} g_class; $g++

[Bug c++/95892] Wrong line number in "-Wsign-conversion" warning message

2020-06-26 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95892 --- Comment #3 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #1) > This is a well-known issue where diagnostics in function parameter-lists all > have the location of the closing brace. Thank you, Jonathan. I guess bug 95831

[Bug c++/95809] GCC treats inline namespace declaration as "ambiguous"

2020-06-26 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95809 --- Comment #3 from Haoxin Tu --- (In reply to Nathan Sidwell from comment #2) > yup, dr2061 made that ill-formed. > > p1701 (wg21.link/p1701) documents the behaviour and it appears EWG is > exploring another avenue to resolve the underlying

[Bug c++/95932] New: ICE in redeclare_class_template, at cp/pt.c:6231

2020-06-26 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE. $cat bug.cc template > struct a < class b{}, struct b { $g++

[Bug c++/95925] New: ICE in xref_basetypes, at cp/decl.c:15169

2020-06-26 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC ICE. $cat bug.cc class a; template https://gcc.gnu.org/bugs/> for instructions.

[Bug c++/95927] New: ICE in cp_lexer_new_from_tokens, at cp/parser.c:701

2020-06-26 Thread haoxintu at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC ICE. $cat bug.cc class { struct a < struct { b ( { $g++ bug.cc bug.cc:2:8: er

[Bug c++/95930] New: ICE: Segmentation fault signal terminated program cc1plus

2020-06-26 Thread haoxintu at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE with Segmentation fault signal terminated

[Bug c++/95931] New: ICE in dependent_type_p, at cp/pt.c:26326

2020-06-26 Thread haoxintu at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE. $cat bug.cc void a { [] (auto, volatile b $g++ bug.cc bug.cc:1:6: error: variable or field ‘a’ declared void 1

[Bug c++/95935] New: ICE : Segmentation fault

2020-06-26 Thread haoxintu at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE with Segmentation fault. $cat bug.cc enum struct a; template enum struct a { $g++ bug.cc bug.cc

[Bug c++/95954] New: ICE: unexpected expression ‘(a)’ of kind paren_expr

2020-06-28 Thread haoxintu at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE. $cat bug.cc short a; thread_local b ( auto

[Bug c++/95956] New: ICE in check_bases, at cp/class.c:1689

2020-06-28 Thread haoxintu at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE. $cat bug.cc a ( auto struct : decltype ( auto ) { { $g++ bug.cc

[Bug c++/95955] New: ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952

2020-06-28 Thread haoxintu at gmail dot com
: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE. $cat bug.cc enum class a : struct {} template < < > > enum class a : union b {} enum class a { c $g++ bug.cc bug.cc:1:25: error: expected ‘;’ after struct definition 1

  1   2   >