public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109506] New: [13 regression] 'error: inlining failed in call to ‘always_inline’ ‘foo<T>::foo() [with T = void]’: function body not available'
@ 2023-04-13 21:31 sjames at gcc dot gnu.org
  2023-04-13 21:38 ` [Bug c++/109506] " pinskia at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-13 21:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109506
           Summary: [13 regression] 'error: inlining failed in call to
                    ‘always_inline’ ‘foo<T>::foo() [with T = void]’:
                    function body not available'
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

```
$ cat /tmp/foo.cxx
template <typename T> struct foo {
  __attribute__((__always_inline__)) foo() {};
};
template <typename T> class bar {
  foo<void> alloc_ {};
};
template <typename... A>
void func1(A &&...) {
  bar<void>();
}
void func2() {
  func1();
}

$ g++ -c -std=c++20 /tmp/foo.cxx
/tmp/foo.cxx: In constructor ‘constexpr bar<void>::bar()’:
/tmp/foo.cxx:2:38: error: inlining failed in call to ‘always_inline’
‘foo<T>::foo() [with T = void]’: function body not available
    2 |   __attribute__((__always_inline__)) foo() {};
      |                                      ^~~
/tmp/foo.cxx:4:29: note: called from here
    4 | template <typename T> class bar {
      |                             ^~~

$ g++ --version
g++ (Gentoo Hardened 13.0.1_pre20230409-r4 p9) 13.0.1 20230409 (experimental)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

It compiles if the template on func1 is removed.

This works with 12 and Arsen reports that an earlier 13 is ok, but not had a
chance to bisect yet.

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

end of thread, other threads:[~2023-08-11 19:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 21:31 [Bug c++/109506] New: [13 regression] 'error: inlining failed in call to ‘always_inline’ ‘foo<T>::foo() [with T = void]’: function body not available' sjames at gcc dot gnu.org
2023-04-13 21:38 ` [Bug c++/109506] " pinskia at gcc dot gnu.org
2023-04-13 21:41 ` pinskia at gcc dot gnu.org
2023-04-13 21:50 ` mpolacek at gcc dot gnu.org
2023-04-13 21:56 ` pinskia at gcc dot gnu.org
2023-04-13 21:57 ` pinskia at gcc dot gnu.org
2023-04-13 22:01 ` [Bug c++/109506] [10/11/12/13 regression] -fchecking=2 causes some template constructor not be instantiated when used with NSDMI pinskia at gcc dot gnu.org
2023-04-13 22:18 ` pinskia at gcc dot gnu.org
2023-04-13 22:19 ` pinskia at gcc dot gnu.org
2023-04-15  1:15 ` sjames at gcc dot gnu.org
2023-04-17 17:33 ` [Bug c++/109506] [10/11/12/13/14 " ppalka at gcc dot gnu.org
2023-04-27 15:20 ` ppalka at gcc dot gnu.org
2023-05-02 12:49 ` cvs-commit at gcc dot gnu.org
2023-05-05 15:22 ` [Bug c++/109506] [10/11/12/13 " cvs-commit at gcc dot gnu.org
2023-07-07 10:45 ` [Bug c++/109506] [11/12 " rguenth at gcc dot gnu.org
2023-08-11 19:19 ` jason 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).