[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/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 are

[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++/91867] Internal compiler error in simple for(auto) loop when using -std=c++11 with -fconcepts

2020-05-22 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++/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 al

[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 cha

[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 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++/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 “-fsanitize=nonnull-at

[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 zero on

[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 trap

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

2020-05-29 Thread haoxintu at gmail dot com
y: P3 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 Mile

[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 &x1 = *(int *)nullptr; // null reference return 0; } GCC can not catch any warning when I use -Wnull-dereference option

[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++/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++/65969] typename allowed in using declaration of non-types names

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

[Bug c++/95559] New: Compiling "{{}}" result is inconsistent in different versions

2020-06-05 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 case test.cc #include int main() { return {{}}; } In the version of GCC 6.1 - 8.4, it's compiled ok. But in GCC 6.

[Bug c++/95564] New: GCC rejects lambda expression with "noexcept(1+1)"

2020-06-06 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 test.cc int main(){ auto a = [ & ] (...) noexcept(1+1) {}; return 0; } $g++-trunk test.cc test.cc:2:38: error: narrowing conversion of &#x

[Bug c++/95597] New: Rejects using-declaration with "typename" in global area

2020-06-08 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 case test.cc typedef int T; using typename ::T; GCC fails to compile it. $g++ -c test.cc test.cc:2:18: error: expected n

[Bug c++/95610] New: GCC fails to get global variable via "::" in class specifier

2020-06-09 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 case test.cc class s; class ::s { } ss; $g++ -c test.cc test.cc:2:11: error: global qualification of class name is inva

[Bug c++/95559] GCC fails to compile "{{}}" in some versions

2020-06-09 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95559 --- Comment #2 from Haoxin Tu --- (In reply to Marek Polacek from comment #1) > I can't find a version of GCC that compiled this. Hi, so sorry I might use the wrong test case. Please try this case bug.cc instead #include int main(){ int

[Bug c++/95559] GCC fails to compile "{{}}" in some versions

2020-06-09 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95559 --- Comment #3 from Haoxin Tu --- (In reply to Haoxin Tu from comment #2) > $g++-8 test.cc ; ./a.out > 0 Here is > $g++-8 bug.cc ; ./a.out > 0

[Bug c++/95559] GCC accepts "too many braces around scalar initializer " in the version of 6.1 - 8.4

2020-06-10 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95559 --- Comment #5 from Haoxin Tu --- (In reply to Marek Polacek from comment #4) > That's the same case, initializing an int with {{}}. GCC 8 compiled the > second testcase, but that was fixed in r269045. Ok, got it. At least this was a bug, can y

[Bug c++/95641] New: Bogus error message in the class base specifier

2020-06-11 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 class A {}; class B : virtual class A{}; In gcc-trunk $g++ -c bug.cc bug.cc:2:19: error: expected class-name before ‘class’ 2 | class B : virtual class

[Bug c++/95656] New: Inconsistent output in compiling an undefined function

2020-06-12 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 #include int main(){ int a (); std::cout << a << std::endl; return 0; } In GCC-trunk without "-fsanitize=undefined"

[Bug c++/95657] New: Bogus error message in "auto" with -std=c++11

2020-06-12 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 bug.cc decltype (auto) foo( decltype (auto) a ){ } in GCC-trunk $g++ -c -std=c++11 bug.cc bug.cc:1:11: error: expected primary-expression before ‘a

[Bug c++/95658] New: Bogus duplicate error message in "decltype(auto)" type specifier

2020-06-12 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 bug.cc in GCC 8.1 - 9.3 gives the bogus duplicate error messages. $cat bug.cc decltype (auto) var = 0; Take GCC-9, G

[Bug c++/95659] New: Inconsistent error message in "default argument missing for parameter"

2020-06-12 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: --- $cat bug.cc int a; long foo1 ( void = a, double param2 ,decltype (auto) param3 = a){ } long foo2 ( void = a, doub

[Bug c++/95672] New: ICE in cxx_incomplete_type_diagnostic, at cp/typeck2.c:584

2020-06-14 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 bug.cc struct g_class : decltype (auto) ... { } ; $g++ bug.cc bug.cc:1:35: internal compiler error: in cxx_incomplete_type_diagnostic, at

[Bug c++/95672] ICE in cxx_incomplete_type_diagnostic, at cp/typeck2.c:584

2020-06-14 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95672 --- Comment #1 from Haoxin Tu --- Noted that from GCC 6.1 to the trunk versions have this ICE, too.

[Bug c++/95672] ICE in cxx_incomplete_type_diagnostic, at cp/typeck2.c:584

2020-06-15 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95672 --- Comment #3 from Haoxin Tu --- (In reply to Martin Liška from comment #2) > Is it an invalid code right? Yes. I think it's not a valid code and other compilers do not accept it, too.

[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++/95724] New: bogue error : "expected '{' before ')' token"

2020-06-17 Thread haoxintu at gmail dot com
rity: P3 Component: 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 : dec

[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++/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" keywo

[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++/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 #6 from Haoxin Tu --- Hi, there. I hold the view that the compiler should have good fault tolerance, which means giving an input(even invalid), the compiler might emit appropriate error message diagnostics so that we can fix them int

[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 #7 from Haoxin Tu --- By the way, can you take a look at bug 95597 and bug 95659? I think GCC should accept the first case and shouldn't miss the error message in the second code. Those cases are different from this report.

[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 input

[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 with

[Bug c++/95807] New: GCC accepts "void value not ignored as it ought to be" in function template

2020-06-21 Thread haoxintu at gmail dot com
Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- GCC accepts "void value not ignored as it ought to be" in a function tem

[Bug c++/95807] GCC accepts "void value not ignored as it ought to be" in function template

2020-06-21 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95807 --- Comment #2 from Haoxin Tu --- (In reply to Andrew Pinski from comment #1) > I think it is rejected at instanition time. Hi, Andrew. Shouldn't it be rejected at compiling time? Please take a look at another case, test.cc $cat test.cc void f

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

2020-06-21 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, bug.cc, GCC fails to compile it, while clang, icc, or msvc accepts it well. $cat bug.cc namespace g_namespace

[Bug c++/95807] GCC accepts "void value not ignored as it ought to be" in function template

2020-06-22 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95807 --- Comment #4 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #3) > The ill-formed template is not diagnosed unless you instantiate it. > That is allowed by the standard. Thank you Jonathan, thanks for your response. As other maj

[Bug c++/95807] GCC accepts "void value not ignored as it ought to be" in function template

2020-06-22 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95807 --- Comment #6 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #5) > What practical impact does this have on any real world code? > Why should we spend time on that, rather than the million other things we > have to fix? Hi, Jonath

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

2020-06-22 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 bug.cc, reduced by C-Reduce, makes GCC crashed. $cat bug.cc wchar_t a = [] (struct { $g

[Bug c++/95820] New: ICE in splice_late_return_type, at cp/pt.c:29034

2020-06-22 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 case bug.cc, reduced by C-Reduce, crashed GCC. $cat bug.cc constexpr (*a)()->bool, $g++ -w -fpermissive small.cc bug.cc:1

[Bug c++/95820] ICE in splice_late_return_type, at cp/pt.c:29034

2020-06-22 Thread haoxintu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95820 --- Comment #1 from Haoxin Tu --- (In reply to Haoxin Tu from comment #0) > $g++ -w -fpermissive small.cc Here is a mistake, and it should be $g++ -w -fpermissive bug.cc

[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++/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++/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
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, GC

[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] New: Wrong line number in "-Wsign-conversion" warning message

2020-06-25 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 might give the wrong line number

[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 has

[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 p

[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 #5 from Haoxin Tu --- (In reply to Jonathan Wakely from comment #4) > Yes, thanks, I've closed that one as a duplicate too. Ok, you are so welcome. By the way, could you please check other diagnostic issues (bug95871, bug95872, bug9

[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++/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++/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++/95936] New: ICE in splice_late_return_type, at cp/pt.c:29114

2020-06-27 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 typedef (*a)()->const = $g++ -fpermissive -w bug.cc bug

[Bug c++/95937] New: ICE in finish_class_member_access_expr, at cp/typeck.c:3133

2020-06-27 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 void a { [].decltype(auto)::b

[Bug c++/95938] New: ICE in synthesize_implicit_template_parm, at cp/parser.c:44077

2020-06-27 Thread haoxintu at gmail dot com
-code 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 a ( union { auto $g

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

2020-06-28 Thread haoxintu at gmail dot com
: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, reduce by C-Reduce, makes GCC-trunk ICE. $cat bug.cc a ( auto struct { b ( $g++ -w bug.cc bug.cc:1:17: error: types may not be

[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 , = ( a

[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 |

[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++/95972] New: ICE in check_member_template, at cp/decl2.c:570

2020-06-29 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 a() { [] ( struct { b ( auto $g++ -w bug.cc

[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++/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++/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++/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, v

[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 | struc

[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++/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++/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++/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 should

[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

[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 inval

[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++/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 guess GCC

[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++/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++/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++/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 c

[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 you

[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

  1   2   >