public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104798] New: Regression: [[gnu::always_inline]] ignored on lambda, no warning emitted
@ 2022-03-05 16:30 jstein27 at binghamton dot edu
  2022-03-05 16:38 ` [Bug c++/104798] " jstein27 at binghamton dot edu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jstein27 at binghamton dot edu @ 2022-03-05 16:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104798

            Bug ID: 104798
           Summary: Regression: [[gnu::always_inline]] ignored on lambda,
                    no warning emitted
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jstein27 at binghamton dot edu
  Target Milestone: ---

GCC 8: always_inline works on lambdas with both the __attribute__ syntax and
the attribute specifier sequence syntax.

GCC 9: always_inline works on lambdas with the __attribute__ syntax but not the
attribute specifier sequence syntax, a warning is emitted with -Wattributes.

GCC 10, 11: always_inline works on lambdas with the __attribute__ syntax but
not the attribute specifier sequence syntax, a warning is NOT emitted with
-Wattributes.

Originally noticed on Compiler Explorer, so unfortunately, I can't provide more
details easily regarding how the compiler was compiled and so on.

Compiler explorer link to play with: https://gcc.godbolt.org/z/cnqh3v5of

Code snippet:

#include <cstdio>

#if USE_SCOPED
static auto l1 = [](auto v) [[gnu::always_inline]]
{
    printf("%d\n", v * 2);
};
#else
static auto l1 = [](auto v) __attribute__((always_inline))
{
    printf("%d\n", v * 2);
};
#endif

int main() {
    l1(1);
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-07 13:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-05 16:30 [Bug c++/104798] New: Regression: [[gnu::always_inline]] ignored on lambda, no warning emitted jstein27 at binghamton dot edu
2022-03-05 16:38 ` [Bug c++/104798] " jstein27 at binghamton dot edu
2022-03-06  2:18 ` jstein27 at binghamton dot edu
2022-03-06  4:05 ` jstein27 at binghamton dot edu
2022-03-07 13:12 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).