[Bug other/95913] New: Capturing lambdas inlining behavior changed in GCC 10.x

2020-06-26 Thread leonid.satanovsky at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95913

Bug ID: 95913
   Summary: Capturing lambdas inlining behavior changed in GCC
10.x
   Product: gcc
   Version: 10.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: leonid.satanovsky at gmail dot com
  Target Milestone: ---

Greetings!

There is a bug suspicion, and I wanted to report it by the following example.

https://godbolt.org/z/m6g3Ug  

GCCs 9.x and older inline capturing lambdas for the case in example even on -O1
GCC 10.1 always inlines only on -O3. On -O2 inlines it only if capturing lambda
is called < 3 times in a row.


Best regards, Leonid.

[Bug c++/79502] [c++1z] [[nodiscard]] attribute ignored for class template

2024-08-21 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79502

Leonid Satanovsky  changed:

   What|Removed |Added

 CC||leonid.satanovsky at gmail dot 
com

--- Comment #7 from Leonid Satanovsky  ---
Hi.

The issue still exists in latest GCC:

Here are more diverse examples:

https://godbolt.org/z/faaf3K1bj

[Bug c++/116441] New: [[nodiscard]] attribute ignored in some cases

2024-08-21 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116441

Bug ID: 116441
   Summary: [[nodiscard]] attribute ignored in some cases
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: leonid.satanovsky at gmail dot com
  Target Milestone: ---

The issue is similar to 79502 and still exists in latest GCC.

Here are more diverse examples (including non-templates):

https://godbolt.org/z/faaf3K1bj

[Bug c++/116441] [[nodiscard]] attribute ignored in some cases

2024-08-21 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116441

--- Comment #2 from Leonid Satanovsky  ---
Dear gcc maintainers, one little asking: if that is not contradicting with the
general guidelines and since you are using bug reproductions provided by the
modest users of gcc, could you please also refer in the commit messages about
the authors of those reproductions, because by submitting relevant reduced
cases they are doing "half" of work. I think that would be reasonably fair.

[Bug c++/116441] [[nodiscard]] attribute ignored in some cases

2024-08-21 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116441

--- Comment #4 from Leonid Satanovsky  ---
Ok, thank you.

[Bug c++/116441] [[nodiscard]] attribute ignored in some cases

2024-08-21 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116441

--- Comment #5 from Leonid Satanovsky  ---
N.B.:

#include  is for sure not needed for reproduction (just a leftover
from earlier experiments)

[Bug c++/85973] [[nodiscard]] on class shall emit a warning for unused anonymous variable

2024-08-27 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85973

--- Comment #6 from Leonid Satanovsky  ---
As you are marking other bugs as duplicates of the current bug, please don't
forget to transfer the useful test cases not mentioned in current bug (e.g.
GccFailedNoDiscard2 case seen below):

struct [[nodiscard]] GccFailedNoDiscard1 {};
struct GccFailedNoDiscard2 { [[nodiscard]] GccFailedNoDiscard2() = default;};
template struct [[nodiscard]] GccFailedNoDiscard3 {};

struct GccOKNoDiscard1 { [[nodiscard]] GccOKNoDiscard1() {}};
template struct GccOKNoDiscard2 {
[[nodiscard]] GccOKNoDiscard2() {}};

int main() {
GccFailedNoDiscard1 {};
GccFailedNoDiscard2 {};
GccFailedNoDiscard3 {};
GccOKNoDiscard1 {};
GccOKNoDiscard2 {};
}

[Bug c++/116441] [[nodiscard]] attribute ignored in some cases

2024-08-27 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116441

--- Comment #7 from Leonid Satanovsky  ---
(In reply to Andrew Pinski from comment #6)
> This is a dup of bug 85973.
> 
> I even make mention of moving the attribute to the constructor makes the
> warning/error happen:
> > Note if we move the attribute to the constructor, then GCC will error out.
> 
> *** This bug has been marked as a duplicate of bug 85973 ***


Andrew, I don't personally care via which bug this issue shall be fixed,
however, the test cases present here and omitted in 85973 should be taken into
account
(e.g. the case with the attribute added to the default-ed constructor)

Thanks.

[Bug c++/88313] generic lambda in default template argument

2024-07-29 Thread leonid.satanovsky at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88313

Leonid Satanovsky  changed:

   What|Removed |Added

 CC||leonid.satanovsky at gmail dot 
com

--- Comment #4 from Leonid Satanovsky  ---
Greetings, the bug still exists in latest Gcc (14+):

C++20

-
Works:

#include 

constexpr auto l = [](auto v) {return v;};
template
constexpr auto c(L f = {}) {return f(42);}
int main () {std::cout << c() << std::endl;}

-
Works:

#include 

constexpr auto c(decltype([](auto v) {return v;}) f = {}) {return f(42);}
int main () { std::cout << c() << std::endl; }

-
(Gcc 14 and latest trunk) Doesn't work / (Clang) Works:
(https://godbolt.org/z/bcbP44bK3)

#include 

template 
constexpr auto c(F f = {}) {return f(42);}
int main () { std::cout << c() << std::endl; }