[Bug c++/96408] New: C++20 new attribute [[no_unique_address]] occurs the internal compile error

2020-08-01 Thread hewillk at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Using built-in specs. COLLECT_GCC=/usr/local/bin/gcc-10 COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/10.1.0/libexec/gcc/x86_64

[Bug c++/96408] C++20 new attribute [[no_unique_address]] occurs the internal compile error

2020-08-01 Thread hewillk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96408 --- Comment #1 from 康桓瑋 --- Created attachment 48976 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48976&action=edit the preprocessed file gcc -v -save-temps -std=c++20 main.cpp

[Bug c++/96409] New: A lambda with a template parameter list inside the template function using C++20 nested requirements clauses occurs internal compiler error

2020-08-01 Thread hewillk at gmail dot com
: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Created attachment 48977 --> ht

[Bug c++/96409] A lambda with a template parameter list inside the template function using C++20 nested requirements clauses occurs internal compiler error

2020-08-01 Thread hewillk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96409 --- Comment #1 from 康桓瑋 --- Created attachment 48978 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48978&action=edit the source file

[Bug c++/96408] C++20 new attribute [[no_unique_address]] occurs the internal compile error

2020-08-01 Thread hewillk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96408 --- Comment #2 from 康桓瑋 --- Created attachment 48979 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48979&action=edit the source file

[Bug c++/96410] New: A lambda with a template parameter list using C++20 requires clauses is not usable in a constant expression

2020-08-01 Thread hewillk at gmail dot com
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Created attachment 48980 --> https://gcc.gnu.org/bugzilla/attachment.

[Bug c++/96410] A lambda with a template parameter list inside the template function using C++20 requires clauses is not usable in a constant expression

2020-08-01 Thread hewillk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96410 --- Comment #1 from 康桓瑋 --- Equivalent example: https://godbolt.org/z/chYW3c

[Bug c++/96408] C++20 new attribute [[no_unique_address]] occurs internal compile error

2020-08-01 Thread hewillk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96408 --- Comment #3 from 康桓瑋 --- Live example: https://godbolt.org/z/vMT5Md

[Bug c++/96409] A lambda with a template parameter list inside the template function using C++20 nested requirements clauses occurs internal compiler error

2020-08-01 Thread hewillk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96409 --- Comment #2 from 康桓瑋 --- Equivalent example: https://godbolt.org/z/n47Gfh

[Bug c++/96497] New: Compare std::variant with int using C++20 <=> is not a constant expression

2020-08-06 Thread hewillk at gmail dot com
verity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- #include #include using variant = std::variant; constexpr auto operator<=>(const variant& v, const auto&am

[Bug c++/96499] New: Compare std::variant with int using C++20 <=> occurs internal compiler error

2020-08-06 Thread hewillk at gmail dot com
verity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- #include constexpr auto operator<=>(const auto& v, const auto& u) { return std::visit([&u](const a

[Bug c++/96575] New: std::ranges::sort is not usable as a 'constexpr' function when saving its return value in lambda function

2020-08-11 Thread hewillk at gmail dot com
sion: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- (https://godbolt.org/z/W8zx58) #include #include constexpr auto f

[Bug c++/96576] New: ICE when decltype std::index_sequence

2020-08-11 Thread hewillk at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- #include auto operator|(auto S, auto) { return S; } int main() { decltype(std::index_sequence<0>{} | 0 | 0); } gives: : In function 'int main()': :9:43: interna

[Bug c++/96575] std::ranges::sort is not usable as a 'constexpr' function when saving its return value in lambda function

2020-08-12 Thread hewillk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96575 --- Comment #1 from 康桓瑋 --- I don't know whether this is same issue or not: #include constexpr auto replace = [](auto old_x, auto new_x) { return [=](auto r) { return std::ranges::replace(r, old_x, new_x); }; }; // this one is ok con

[Bug c++/99361] New: "unused variable" warning on a used variable in template lambda

2021-03-03 Thread hewillk at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code: auto f() { const auto x = 1; return [] (auto) { return x; }; } will emit unused variable warnings with &

[Bug c++/99379] New: lambda declared with deduced type 'auto' can appear in its own initializer

2021-03-04 Thread hewillk at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code accepts by GCC-trunk: auto x = [x]{ }; godbolt: https://godbolt.org/z/e76Kn1

[Bug c++/99379] lambda declared with deduced type 'auto' can appear in its own initializer

2021-03-04 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99379 --- Comment #1 from 康桓瑋 --- I find this: https://stackoverflow.com/questions/25693676/auto-variable-used-in-lambda-in-its-own-initializer So this is not a bug.

[Bug c++/99465] New: Segmentation fault when put lambda into requires clause

2021-03-08 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code will trigger the segmentation fault of gcc-trunk: template auto g() requires ([] { return 0; } ()); int main() { g

[Bug c++/99465] Segmentation fault when put lambda into requires clause

2021-03-08 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99465 --- Comment #1 from 康桓瑋 --- Other related ICE: template requires ([]{}()); auto f() requires ([]{}()); https://godbolt.org/z/8z3PPx

[Bug c++/99465] Segmentation fault when put lambda into requires clause

2021-03-08 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99465 --- Comment #2 from 康桓瑋 --- Here is the minimal reduced example: f() requires [ godbolt: https://godbolt.org/z/eMWxPj

[Bug c++/99478] New: ICE when decltype lambda in template list

2021-03-08 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code will trigger ICE on gcc-9.1 ~ gcc-trunk with "-std=c++2a" mode: template auto f() {} int main() { f<{}>(); } (godbolt: https://godbolt.org/z/dEP5PT)

[Bug c++/99505] New: ICE Segmentation fault when decltype lambda in parameter list

2021-03-09 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This may be related/duplicated to the 99478, but I am not sure. The following code will trigger ICE only on gcc-9: int main

[Bug c++/99505] ICE Segmentation fault when decltype lambda in parameter list

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99505 --- Comment #2 from 康桓瑋 --- Yep, wandbox (https://wandbox.org/permlink/OUJpCz6dFrlA1vod) compiles fine. This invalid code maybe can reproduce that locally. int main() { [] (decltype([]{})) {} (); } (wandbox: https://wandbox.org/permlink/re9

[Bug c++/99511] New: default arguments are allowed for parameters of a requires expression

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code should not be accepted by gcc-10, since default arguments are not allowed for parameters of a requires expression

[Bug c++/99513] New: ICE Segmentation fault when decltype lambda in concept template list

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This may be related/duplicated to the 99505, but I am not sure. The following invalid code will trigger Segmentation fault on gcc-10

[Bug c++/99516] New: Erroneous lambda conversion in default non-type template list

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- GCC 9, 10, 11 rejects the following code: template struct S {}; S<> s; (godbolt: https://godbolt.org/z/Gs4776)

[Bug c++/99521] New: ICE Segmentation fault when decltype lambda in requires clause

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This may be related/duplicated to the 99513, but I am not sure. The following invalid code will

[Bug c++/99521] ICE Segmentation fault when decltype lambda in requires clause

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99521 康桓瑋 changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/99465] Segmentation fault when put lambda into requires clause

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99465 --- Comment #3 from 康桓瑋 --- *** Bug 99521 has been marked as a duplicate of this bug. ***

[Bug c++/99361] "unused variable" warning on a used variable in template lambda

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99361 康桓瑋 changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEW

[Bug c++/96311] [8/9/10/11 Regression] false positive for -Wunused-but-set-variable (const/constexpr identifier used in generic lambda)

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96311 康桓瑋 changed: What|Removed |Added CC||hewillk at gmail dot com --- Comment #5 from 康桓瑋

[Bug c++/99538] New: ICE when lambda return requires clause

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code will trigger the ICE of gcc-10 and trunk: int main(){ [] { return requires { []{}; }; }; } (godbolt: https://godbolt.org/z/WGjx9h)

[Bug c++/99539] New: Varargs are allowed in requires expression

2021-03-10 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- gcc-trunk accepts the following code: template concept C = requires(T t, ...) {// error: terminates with an ellipsis t; }; (goldbot: https://godbolt.org/z/qbz7b9) but

[Bug c++/99546] New: Weird return value of C++20 requires expression

2021-03-11 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- gcc-trunk accepts following code: int main() { constexpr auto b = requires { []{}; }; static_assert(b); static_assert(!b); } (godbolt: https://godbolt.org/z/4K5vq8)

[Bug c++/99546] Weird return value of C++20 requires expression

2021-03-11 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99546 --- Comment #1 from 康桓瑋 --- You can see more weird cases in this: https://stackoverflow.com/questions/66578966/weird-return-value-of-c20-requires-expression.

[Bug c++/99583] New: Parameter packs not expanded in lambda noexcept specifier

2021-03-14 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following valid code failed since gcc-4.7 void f(...); template void g() { f([]() noexcept(B) {} ...); } (goldbot: https

[Bug c++/99584] New: ICE Segmentation fault when expanding lambda noexcept specifier with invalid parameter pack

2021-03-14 Thread hewillk at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This may be related/duplicated to PR 99513 or PR 99583, but I am not sure. The following invalid code triggers

[Bug c++/99589] New: lambda init-capture without initializer in C++20

2021-03-14 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- gcc-9 should reject this code: void f(auto... args) { ([...args]{}, ...); } according to [expr.prim.lambda#nt:init-capture], the "...args" in capture list must

[Bug c++/99590] New: ICE when pack expansion with lambda

2021-03-15 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code will trigger ICE on gcc-8 ~ gcc-trunk with "-std=c++2a" mode: void g(auto... args) { ([args...](auto){}(args), ...); } int main() { g(0, 1); } (gold

[Bug c++/99590] ICE when pack expansion with lambda

2021-03-15 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99590 --- Comment #1 from 康桓瑋 --- I think this is a valid code: void g(auto... args) { ([args...](auto...){}(args ), ...); } void f(auto... args) { ([args ](auto...){}(args...), ...); } int main() { g(0, 1); // this one ICE f(0, 1); //

[Bug c++/99594] New: Parameter packs not expanded in lambda requires clause

2021-03-15 Thread hewillk at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Same form with PR 99583, this code should work: template auto f() { ([](auto) requires (B) {}, ...); } (goldbot: https://godbolt.org/z/jdn4je)

[Bug c++/99595] New: ICE when pack expansion with template lambda

2021-03-15 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code will trigger ICE on gcc-trunk: auto f(auto... args) { ([]{ y; }, ...); } int main() { f(0); } (godbolt: https://godbolt.org/z/11G8G5) (wanbox: https

[Bug c++/99597] New: Parameter packs not expanded in lambda template list

2021-03-15 Thread hewillk at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code intends to work, even if it fails in three major compilers: template void f(Ts...) { ([](){}, ...); } int main() { f(0, 0.5); } (goldbot: https

[Bug c++/99628] New: g++ fails to do the implicit conversion when rewritten operator<=>

2021-03-17 Thread hewillk at gmail dot com via Gcc-bugs
normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- gcc-trunk rejects this valid code: struct S{ operator int() { return 0; } }; auto operator<=>(S, S) { return S{};

[Bug c++/99589] lambda init-capture without initializer in C++20

2021-03-18 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99589 --- Comment #1 from 康桓瑋 --- reduced: auto f(auto x) { [...x]{}; }

[Bug c++/99659] New: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in synthesize_implicit_template_parm, at cp/parser.c:45415

2021-03-19 Thread hewillk at gmail dot com via Gcc-bugs
it_template_parm, at cp/parser.c:45415 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot co

[Bug c++/99672] New: std::source_location yield different column numbers between free function and template functions

2021-03-19 Thread hewillk at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/8T3MGv #include #include auto g(auto...) { std::cout << std::source_lo

[Bug c++/99678] New: c++20 trailing requires clauses allows undeclared identifier

2021-03-19 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/reG8qE void bar(auto) requires undeclared_identifier; GCC accepts this code.

[Bug c++/99546] Weird return value of C++20 requires expression

2021-03-20 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99546 --- Comment #4 from 康桓瑋 --- same form, but this will trigger ICE: struct S{ constexpr static auto s = requires { []; }; }; :1:8: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in overri

[Bug c++/99672] std::source_location yield different column numbers between free function and template functions

2021-03-21 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99672 --- Comment #3 from 康桓瑋 --- I think the issue of line() function also needs to do a patch. https://godbolt.org/z/q8EPnG constexpr int g(auto...) { return std::source_location::current( // < opening paren line number ).line(); } constexpr

[Bug c++/99700] New: gcc takes an uninitialized variable as a constant expression

2021-03-21 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/93qM1b struct A { constexpr A() { c[0] = 0; } char c[2]; }; constexpr A a;

[Bug c++/99730] New: gcc cannot choose the best overload resolution with constrained function

2021-03-23 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- auto f(auto&&...) {} auto f(auto...) requires true {} int main() { f(); } gcc reject with: :5:5: error: call of overl

[Bug c++/99732] New: gcc accepts overload a member function without ref-qualifier with a member function with a ref-qualifier

2021-03-23 Thread hewillk at gmail dot com via Gcc-bugs
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- struct S { constexpr auto f(auto...) &&{ retu

[Bug c++/99730] gcc cannot choose the best overload resolution with constrained function

2021-03-23 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99730 --- Comment #3 from 康桓瑋 --- Really appreciate your reply and explanation.

[Bug c++/99742] New: Parameter packs not expanded with nested requirements

2021-03-23 Thread hewillk at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- template concept C = (requires { requires B; } && ...); static_assert(C); gcc rejects this code. https://godbolt.org/z/c6sEq5KEs

[Bug c++/99743] New: ICE Segmentation fault when use lambda init-capture in requires clause

2021-03-23 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- static_assert(requires { [x = 0]{}; }); https://godbolt.org/z/n9KE4z7P6 I don't know whether this code is well-form or not.

[Bug c++/99745] New: ICE when parameter pack not expanded in bit field

2021-03-23 Thread hewillk at gmail dot com via Gcc-bugs
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/dz1bcxhYf template struct S { int a : sizeof(Ts); }; S s; :3:11: internal compiler error: in dependent_type_p, at cp/pt.c:26775 3 | int a

[Bug c++/99745] ICE when parameter pack not expanded in bit field

2021-03-23 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99745 --- Comment #1 from 康桓瑋 --- Reduce a little: template struct S { int x : Xs; }; S s; :3:7: internal compiler error: unexpected expression 'Xs' of kind template_parm_index 3 | int x : Xs; | ^

[Bug c++/99750] New: gcc allow operator literal operator have default parameters

2021-03-24 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- constexpr auto operator""_s(const char*, unsigned long size = 2) { return size; } static_assert(operator""_s(nu

[Bug libstdc++/99752] New: ranges::find_end should return empty subrange when search range is empty

2021-03-24 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- In ranges::find_end implementation: 674 else 675 { 676 auto __i = ranges::next(__first1, __last1); 677

[Bug libstdc++/99752] ranges::find_end should return empty subrange when search range is empty

2021-03-24 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99752 --- Comment #1 from 康桓瑋 --- My pardon, since the ranges::find_end return type is ranges::subrange, we still to get the common last1 iterator through the ranges::next call, so this seems not a bug.

[Bug libstdc++/99752] ranges::find_end should return empty subrange when search range is empty

2021-03-24 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99752 康桓瑋 changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/99757] New: ICE when parameter pack not expanded with static_data_member

2021-03-24 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- related to PR 99745: template struct S { constexpr static auto x = Ts::x; }; S s; :3:25: internal compiler error: in cp_finish_decl, at cp

[Bug c++/99800] New: ICE Segmentation fault when put lambda in template parameter list

2021-03-27 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/b6cnKo7ej template struct A {}; template struct B {}; template using b = B<[]{ return a; }()>; :3:45: in

[Bug c++/99803] New: internal compiler error: in make_typename_type, at cp/decl.c:4057

2021-03-28 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/4Yfnfzdhe struct A { A(auto); }; A(unsigned) -> A:: template A;

[Bug c++/99806] New: ICE in tsubst_copy of gcc-trunk and tree_code_size of gcc-10

2021-03-28 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/s687ePeGG template concept C = requires (T a) { a.f(0); }; struct S { void f(auto) noexcept(); }; static_assert(C

[Bug c++/99809] New: ICE: sorry, unimplemented: unexpected AST of kind nontype_argument_pack

2021-03-29 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/4dnnTTzMW #include auto f(auto... args) { return [](std::same_as auto) {}; } int main() { f(0)(0

[Bug c++/99811] New: ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.c:13002

2021-03-29 Thread hewillk at gmail dot com via Gcc-bugs
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/shj7Tr65M related to PR 99809: #include template auto f(Ts...)

[Bug c++/99811] ICE: tree check: accessed elt 2 of 'tree_vec' with 1 elts in tsubst_pack_expansion, at cp/pt.c:13002

2021-03-29 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99811 --- Comment #1 from 康桓瑋 --- same form with the different error message: https://godbolt.org/z/hE9n6eEMT #include template auto f(Ts...) { return [] auto> {}; } int main() { f(0).template operator()<0>(); } :9:30: internal compiler err

[Bug c++/99800] ICE Segmentation fault when put lambda in template parameter list

2021-03-29 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99800 康桓瑋 changed: What|Removed |Added Keywords|ice-on-invalid-code |ice-on-valid-code --- Comment #1 from 康桓瑋 --- Thi

[Bug c++/99815] New: ICE: in placeholder_type_constraint_dependent_p, at cp/pt.c:28193

2021-03-29 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/4vx18beMW template concept C = true; template auto bar(Ts...) { C auto x = 0; } :4:37: internal compiler error

[Bug c++/99809] ICE: sorry, unimplemented: unexpected AST of kind nontype_argument_pack

2021-03-29 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99809 --- Comment #2 from 康桓瑋 --- I think this is not a valid code even if clang accepts it, since the parameter packs args are not expanded.

[Bug c++/99831] New: ICE: in reshape_init, at cp/decl.c:6720

2021-03-30 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This is a complicated one since I don't know how to reduce it. https://godbolt.org/z/rqTGxMWef #include template struct StringLiteral { constexpr StringLiteral(const char

[Bug c++/99831] ICE: in reshape_init, at cp/decl.c:6720

2021-03-30 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99831 --- Comment #1 from 康桓瑋 --- Note that if we comment one of the asserts, there will be no problem, or we just comment the redundant std::ranges::sort.

[Bug c++/99831] ICE: in reshape_init, at cp/decl.c:6720

2021-03-30 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99831 --- Comment #4 from 康桓瑋 --- When the array subscript is outside the bounds of array, gcc seems to fall into infinite recursion due to the default operator==. Here is the reduced with no header: struct A { constexpr A(const char*) {} char va

[Bug c++/99844] New: ICE: unexpected expression 'B' of kind template_parm_index

2021-03-30 Thread hewillk at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Related to fixed PR 99745 and PR 99757. https://godbolt.org/z/5qW5a1Mnq template struct S { constexpr explicit(B) S() {} }; con

[Bug c++/99809] ICE: sorry, unimplemented: unexpected AST of kind nontype_argument_pack

2021-03-31 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99809 --- Comment #3 from 康桓瑋 --- More reduced: template concept C = true; void f(auto... args) { [](C auto) {}; } int main() { f(); }

[Bug c++/99848] New: Parameter packs not expanded in type-constraint placeholder

2021-03-31 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/hxed4eorx template concept C = false; template auto f(Ts...) { ([](C auto){}, ...); } gcc rejects it.

[Bug c++/99850] New: [P1102R2] reject valid lambda syntax in C++23

2021-03-31 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/x5E5cGPTb auto l = [] requires true -> void {}; gcc incorrectly rejects this valid lambda, you can see more details in https://stackoverflow.com/questi

[Bug c++/99850] [P1102R2] reject valid lambda syntax in C++23

2021-03-31 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99850 --- Comment #4 from 康桓瑋 --- This ICE may be caused by not handle this form. template concept C = true; auto l = [] requires (C && ...) -> void {}; https://godbolt.org/z/vo8xPd4hY :3:48: internal compiler error: Segmentation fault 3 | aut

[Bug c++/99869] New: ICE: in do_auto_deduction, at cp/pt.c:29620

2021-04-01 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This is a small variant of fixed PR 99815. https://godbolt.org/z/jezs4qh3E template concept C = true; template auto bar(Ts...) { for (C auto c : ""); } :4:42

[Bug c++/99874] New: ICE Segmentation fault when declared variable template of template lambda

2021-04-01 Thread hewillk at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/4fxhP6jf9 template auto l = [] requires requires { x; } {}; int main() { l<0>.template operat

[Bug c++/99897] New: ICE Segmentation fault when operator appear in template parameter-list

2021-04-03 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/fjx8cG995 template struct A {}; template struct S { void foo(S<+a>); }; :2:40: internal compiler

[Bug c++/99899] New: ICE: in do_auto_deduction, at cp/pt.c:29630

2021-04-03 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This is a small variant of fixed PR 99815, PR 99869. https://godbolt.org/z/zrnPqdenx template concept C = true; struct S { int a, b; }; template auto bar(Ts...) { C auto [a, b

[Bug c++/99904] New: ICE: in tsubst_pack_expansion, at cp/pt.c:13056

2021-04-04 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- maybe dup of PR 99595. https://godbolt.org/z/zarsP11Y6 template concept C = true; template struct A {}; template class> struct S {}; constexpr S s; :5:14: inter

[Bug c++/99909] New: The value of 'std::is_integral_v' is not usable in a constant expression

2021-04-04 Thread hewillk at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/jWr39rrsT #include template struct S {}; template class> constexpr auto f() {} int

[Bug c++/99916] New: ICE Segmentation fault when erroneous structured bindings appears in requires-clause

2021-04-05 Thread hewillk at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/cW8367TTr struct S {} s; template concept C = requires { [a] = s; }; static_assert(C); :2:41

[Bug c++/99923] New: Rejects valid if statement with default argument concept

2021-04-05 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/zPPMEaa33 template concept C = true; void foo() { if (C<>) return; } gcc rejects this valid grammar with: : In fu

[Bug c++/99925] New: Missing 'inconsistent deduction for ‘auto’' error when using type-constraint placeholder

2021-04-05 Thread hewillk at gmail dot com via Gcc-bugs
NCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Maybe dup of PR 79009. https://godbolt.org/z/sGacxEj31 template concept C = true; C auto i = 0, j = 0.5, k = "";

[Bug c++/99958] New: The seems to contain the entire and in C++20 mode

2021-04-07 Thread hewillk at gmail dot com via Gcc-bugs
: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- I found that include will automatically include the entire in C++17 mode, and both the and will be automatically included in C++20 mode: https

[Bug c++/99967] New: gcc accepts declaration type contains unexpanded parameter pack

2021-04-08 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/cdqq3ocTG template concept C = true; template void f() { C auto x = 0; }; int main() { f(); } gcc accepts it.

[Bug c++/99970] New: gcc accepts invalid comparison between pointer and integer in requires-clause

2021-04-08 Thread hewillk at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/qs44TqzKe template void f() requires requires { x == "hello world"; } {}; int main() { f

[Bug c++/99970] gcc accepts invalid comparison between pointer and integer in requires-clause

2021-04-08 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99970 --- Comment #1 from 康桓瑋 --- The requires-expression is a red herring, so it can be simplified to: template void f() { x == nullptr; }; int main() { f(); } Is this ill-formed?

[Bug c++/99976] New: gcc accepts requires-clause contains unexpanded parameter pack

2021-04-08 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/ax7MKM483 template concept C = requires (Ts) { true; }; static_assert(C); gcc accepts it.

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

2021-04-09 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Congratulations on hitting the 10,000 reports mark! https://godbolt.org/z/dhPqd4595 template auto f(Ts...) { [] { enum class e : Ts {}; }; } int main() { f(0, true); } :3

[Bug c++/100006] ICE: in dependent_type_p, at cp/pt.c:26745

2021-04-09 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16 --- Comment #1 from 康桓瑋 --- (In reply to 康桓瑋 from comment #0) > Congratulations on hitting the 10,000 reports mark! > > https://godbolt.org/z/dhPqd4595 > > template > auto f(Ts...) { > [] { enum class e : Ts {}; }; > } > > int main() { >

[Bug c++/100006] [8/9/10/11 Regression] ICE: in dependent_type_p, at cp/pt.c:26745

2021-04-09 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16 --- Comment #3 from 康桓瑋 --- https://godbolt.org/z/o6h8GP6ae Maybe same form: template auto f() { [] { struct S : Ts {}; }; } int main() { f<>(); } :3:15: internal compiler error: in dependent_type_p, at cp/pt.c:26745 3 | [] { stru

[Bug c++/100007] New: Parameter packs not expanded with bit field

2021-04-09 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/ccb69heP9 template auto f() { ([] { struct U { int x : Ns; }; }, ...); ([] { union U { int x : Ns; }; }, ...); } gcc rejects it.

[Bug c++/100019] New: ICE Segmentation fault with try-catch block in lambda

2021-04-10 Thread hewillk at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/WajPza5fM void f(auto... args) { [] { try {} catch (decltype(args)) {} }; } int main() { f(0); } :3:19: internal compiler error

[Bug c++/100022] New: Parameter packs not expanded with alignas specifier

2021-04-10 Thread hewillk at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/49KvrsM9W template void g() { ([] { struct alignas(Ns) S {}; }, ...); } gcc rejects it.

  1   2   3   4   5   6   >