[Bug c++/59329] New: Using `assert(...)` is not allowed in constexpr functions

2013-11-28 Thread vittorio.romeo at outlook dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com inline constexpr int exampleFunction(int min, int max) { assert(min = max); return min + max; } The above function fails to compile, because

[Bug c++/58130] New: [C++11] Compilation fails using const decltype(...) getter() const {...}

2013-08-11 Thread vittorio.romeo at outlook dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Tested both on Windows 8 x86 and Arch Linux x64. Compiling with -O3 -Wall -Wextra -pedantic struct myStruct { std::vectorstd

[Bug c++/58130] [C++11] Compilation fails using const decltype(...) getter() const {...}

2013-08-11 Thread vittorio.romeo at outlook dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58130 --- Comment #1 from Vittorio Romeo vittorio.romeo at outlook dot com --- Isn't decltype(items) equivalent to std::vectorstd::unique_ptrItemBase ?

[Bug c++/58130] [C++11] Compilation fails using const decltype(...) getter() const {...}

2013-08-17 Thread vittorio.romeo at outlook dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58130 Vittorio Romeo vittorio.romeo at outlook dot com changed: What|Removed |Added Status|WAITING

[Bug c++/67248] Variable template cannot be used as dependent name

2015-08-17 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67248 Vittorio Romeo vittorio.romeo at outlook dot com changed: What|Removed |Added CC

[Bug c++/67274] Inconsistent `this-` required when calling member function in a lambda capturing `this` through another function

2015-08-19 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 --- Comment #1 from Vittorio Romeo vittorio.romeo at outlook dot com --- More test cases, using minor variations to the code posted above: With bar() = call([this](auto x){ foo(x); }); clang++ 3.6+ compiles. g++ 5.2+ does not compile. With bar

[Bug c++/67274] New: Inconsistent `this-` required when calling member function in a lambda capturing `this` through another function

2015-08-19 Thread vittorio.romeo at outlook dot com
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Passing a `this`-capturing generic lambda (to a template

[Bug c++/67273] New: Incorrect -Wshadow warning with generic lambdas

2015-08-19 Thread vittorio.romeo at outlook dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- The `-Wshadow` flag fires an incorrect warning using generic lambdas with `auto` type deduction. Minimal example: http://melpon.org/wandbox/permlink/ynGNXTYN8rY40BgY

[Bug c++/68071] New: Generic lambda variadic argument pack cannot be empty

2015-10-23 Thread vittorio.romeo at outlook dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- struct C { template auto operator()(T&& x, TRest&&...){ return x; } }; int main() { // Compiles both with clang and gcc. auto

[Bug c++/68876] New: Segmentation fault with variadic templates, std::forward and decltype

2015-12-12 Thread vittorio.romeo at outlook dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Not sure what's causing the segmentation fault, but here's a minimal example. The segfault happens with g++ 5.1, 5.2

[Bug c++/68965] New: `-Wunused-parameter` is reported in variadic lambda or function using sizeof...(xs)

2015-12-17 Thread vittorio.romeo at outlook dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- gcc.godbolt.org: https://goo.gl/oJf4gs auto count = [](auto&&... xs) { return sizeof...(xs); };

[Bug c++/69057] constexpr static variable template assertion segmentation fault

2015-12-26 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69057 --- Comment #1 from Vittorio Romeo --- > in constexpr expansion of ‘from_enum(array)’ > internal compiler error: Segmentation fault static constexpr GLenum target_value{from_enum(buffer_target::array)};

[Bug c++/69057] New: constexpr static variable template assertion segmentation fault

2015-12-26 Thread vittorio.romeo at outlook dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- gcc.godbolt.org example: https://goo.gl/yGCVOB --- #include using GLenum = unsigned int; template inline constexpr auto

[Bug c++/69066] New: SFINAE compilation error on lambda with trailing return type

2015-12-27 Thread vittorio.romeo at outlook dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- auto bound_f = [=](auto... xs) -> decltype(f(x, xs...)) { return f(x, xs...); }; return curry_impl<decltype(b

[Bug c++/71332] New: Passing non-copyable type by reference to variadic generic lambda after a copyable type by value results in a compile-time error

2016-05-29 Thread vittorio.romeo at outlook dot com
Version: 6.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Created attachment 38592 --> ht

[Bug c++/70631] New: Warn about redundant comparisons with -Wlogical-op

2016-04-11 Thread vittorio.romeo at outlook dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- https://godbolt.org/g/Tt8hfe int main() { int x = 0; // warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op] if(x

[Bug c++/71167] New: Long typenames produce extremely hard to read diagnostics and slow down compilation time

2016-05-17 Thread vittorio.romeo at outlook dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Long typenames, usually generated by heavy template metaprogramming code, result in errors

[Bug c++/70942] New: [c++14] Incorrect deduction of generic lambda `auto&&` parameter

2016-05-04 Thread vittorio.romeo at outlook dot com
critical Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Created attachment 38410 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38410=edit Minimal code examp

[Bug c++/64488] [c++11] Expand initializer list with lambdas in variadic template. Reject valid code.

2017-02-20 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64488 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug c++/79590] ICE (internal compiler error) in nothrow_spec_p with generic lambda and `noexcept(noexcept(...))` expression

2017-04-12 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79590 --- Comment #2 from Vittorio Romeo --- This is still present. Here are some more examples: int main() { [](auto x) noexcept(noexcept(x)) { } (0); } :3:40: internal compiler error: in nothrow_spec_p, at cp/except.c:1159 [](auto x)

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370 --- Comment #4 from Vittorio Romeo --- Even shorter: template struct tuple_size { static constexpr int value = 1; }; template struct tuple_element { typedef int type; }; template struct tuple {}; template

[Bug c++/79180] Nested lambda-capture causes segfault for parameter pack

2017-07-15 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79180 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug c++/52869] [DR 1207] "this" not being allowed in noexcept clauses

2017-09-16 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug c++/81486] Class template argument deduction fails with (), succeeds with {}

2017-11-11 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81486 --- Comment #2 from Vittorio Romeo --- Here's a snippet that seems to reproduce this bug, even without an explicit deduction guide: template struct foo { template foo(Us...) { } }; int main() {

[Bug c++/80871] Template partial ordering considered non-ambiguous with deduced and non-deduced parameter packs

2017-11-11 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80871 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug libstdc++/85771] New: `std::variant<...>` insanely slow to compile compared to `union` (256 types)

2018-05-14 Thread vittorio.romeo at outlook dot com
verity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Consider the following set of types: struct Type0 { int x; }; struct Type1 { int x; }; struct

[Bug c++/47226] [C++0x] GCC doesn't expand template parameter pack that appears in a lambda-expression

2018-04-08 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226 --- Comment #17 from Vittorio Romeo --- Was the patch merged in trunk? The following still fails to compile on 20180407 template int foo() { ([i = Is]{}(), ...); return 0; }

[Bug c++/85305] New: Parameter pack expression in lambda capture list fails as part of a fold expression

2018-04-09 Thread vittorio.romeo at outlook dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- The following code snippet... template void foo() { ([i = Is]{}(), ...); } ...does

[Bug c++/47226] [C++0x] GCC doesn't expand template parameter pack that appears in a lambda-expression

2018-04-09 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226 --- Comment #19 from Vittorio Romeo --- (In reply to Jonathan Wakely from comment #18) > (In reply to Vittorio Romeo from comment #17) > > Was the patch merged in trunk? > > It was committed to trunk: r251433 > > > The following still fails to

[Bug c++/84916] Tweaks to template type elision

2018-03-16 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84916 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug c++/88557] Lambda in template parameter list compiler segmentation fault (ICE)

2018-12-20 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88557 --- Comment #1 from Vittorio Romeo --- The "ice-on-invalid-code" tag was added, but I thought this was valid C++2a code. Am I mistaken?

[Bug c++/88557] New: Lambda in template parameter list compiler segmentation fault (ICE)

2018-12-19 Thread vittorio.romeo at outlook dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- The following code template void f() { } causes an internal compiler error on gcc 9.x version 20181218

[Bug c++/89687] New: Empty pack expansion in `decltype` results in cryptic compiler error (dump_expr)

2019-03-12 Thread vittorio.romeo at outlook dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Consider the following code: template void foo(F f) { [f](auto... xs

[Bug c++/90571] New: Missed optimization opportunity when returning function pointers based on run-time boolean

2019-05-22 Thread vittorio.romeo at outlook dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Given the following two functions: int f() { return 0; } int g() { return 1

[Bug tree-optimization/90571] Missed optimization opportunity when returning function pointers based on run-time boolean

2019-05-23 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90571 --- Comment #4 from Vittorio Romeo --- > I wonder how the "original" testcase looked like - the one in this bug is probably simplified from real-world code? This is what the original author of the code (Filipp Gelman) said: > I was reviewing

[Bug c++/90215] New: ICE with lambda in fold expression over comma and assignment

2019-04-23 Thread vittorio.romeo at outlook dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- The following code #include template struct X { template void f(F f) { f(0

[Bug c++/90215] [8/9 Regression] ICE with lambda in fold expression over comma and assignment

2019-04-24 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90215 --- Comment #3 from Vittorio Romeo --- Changing the lambda to the following std::apply([](auto&... ys) { (xs.f([](auto y) { ys = y; }), ...); }, t); produces a different ICE: :20:9:

[Bug c++/90215] [8/9 Regression] ICE with lambda in fold expression over comma and assignment

2019-04-24 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90215 --- Comment #4 from Vittorio Romeo --- Simplified quite a lot, removed `` dependency: https://gcc.godbolt.org/z/6uNcCN struct X { template void f(F f) { f(0); } }; template void

[Bug c++/81676] Wrong warning with unused-but-set-parameter within 'if constexpr'

2019-08-16 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81676 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug c++/79378] lambda init-capture adds const

2020-07-18 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79378 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug c++/100157] New: Support `__type_pack_element` like Clang

2021-04-20 Thread vittorio.romeo at outlook dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Clang provides a `__type_pack_element` builtin which allows efficient indexing of parameter packs in variadic templates, and it seems that GCC has no equivalent

[Bug libstdc++/100008] New: std::clamp generates suboptimal assembly for primitive types

2021-04-09 Thread vittorio.romeo at outlook dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- `std::clamp` generates poor assembly compared to hand-written counterpart for primitive types like `float`, even

[Bug libstdc++/104719] New: Use of `std::move` in libstdc++ leads to worsened debug performance

2022-02-28 Thread vittorio.romeo at outlook dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- `std::accumulate` is defined as follows in `libstdc++`: ``` template _GLIBCXX20_CONSTEXPR inline _Tp

[Bug libstdc++/104719] Use of `std::move` in libstdc++ leads to worsened debug performance

2022-02-28 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104719 --- Comment #4 from Vittorio Romeo --- I see that `std::move` is indeed inlined with `-Og`, my apologies on not noticing that. I like the idea of having the compiler itself fold calls to things like `std::move` and `std::forward` as suggested

[Bug libstdc++/104719] Use of `std::move` in libstdc++ leads to worsened debug performance

2022-02-28 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104719 --- Comment #6 from Vittorio Romeo --- > The request is to replace it with some kind of magic that does the same as > std::move without actually writing std::move. More generally speaking, ensure that function such as `std::move`,

[Bug libstdc++/104719] Use of `std::move` in libstdc++ leads to worsened debug performance

2022-02-28 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104719 --- Comment #9 from Vittorio Romeo --- I have done some benchmarking for three use cases, both with `-O0` and `-Og`, hacking my `libstdc++` headers to add `[[gnu::always_inline]]` where deemed appropriate. --- The use cases were: 1.

[Bug c++/96780] debuginfo for std::move and std::forward isn't useful

2022-03-01 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96780 --- Comment #7 from Vittorio Romeo --- > As discussed on IRC, we might not want to do this folding at -O0 (although > I'd personally be happy with it unconditionally). I think you should reconsider this as discussed in these places: -

[Bug c++/100157] Support `__type_pack_element` like Clang

2022-06-30 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100157 --- Comment #6 from Vittorio Romeo --- Thank you, Jonathan, for looking into this. I feel like it might be worthwhile to keep the same name as Clang for compatibility, or maybe talk to some Clang developers and see if there can be an agreement

[Bug c++/100157] Support `__type_pack_element` like Clang

2022-06-30 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100157 --- Comment #9 from Vittorio Romeo --- (In reply to Jonathan Wakely from comment #8) > (In reply to Vittorio Romeo from comment #6) > > worthwhile to keep the same name as Clang for compatibility, > > No, that's not an option. Clang's is a

[Bug c++/107105] New: Consider folding `__and_`, `__or_`, and `__not_` at the front-end level

2022-09-30 Thread vittorio.romeo at outlook dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- This is another possible compilation speed improvement that came to mind after running ClangBuildAnalyzer on a few open

[Bug c++/109387] New: "definition of explicitly-defaulted" error with explicit template instantiation

2023-04-03 Thread vittorio.romeo at outlook dot com via Gcc-bugs
NCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Given this code: template struct S { S(); }; // extern template struct S; temp

[Bug c++/89088] Dllexport for explicit template instantiation missing inline methods

2023-04-02 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89088 Vittorio Romeo changed: What|Removed |Added CC||vittorio.romeo at outlook dot com

[Bug c++/109380] New: inline member function symbol not exported with explicit template instantiation declaration on MinGW

2023-04-02 Thread vittorio.romeo at outlook dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vittorio.romeo at outlook dot com Target Milestone: --- Created attachment 54801 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54801=e

[Bug target/109380] inline member function symbol not exported with explicit template instantiation declaration on MinGW

2023-04-02 Thread vittorio.romeo at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109380 --- Comment #2 from Vittorio Romeo --- Hmm, you might be correct. Seeing that the issue has not been looked at since 2017, are you aware of any workaround besides `-Wl,--export-all-symbols`? The issue is preventing me from applying explicit