public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102045] New: constructor is not being instantiated
@ 2021-08-24 15:10 hanicka at hanicka dot net
  2021-08-24 15:17 ` [Bug c++/102045] " mpolacek at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hanicka at hanicka dot net @ 2021-08-24 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102045
           Summary: constructor is not being instantiated
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hanicka at hanicka dot net
  Target Milestone: ---

this error is in 11.0+ (including current trunk) and wasn't in gcc-10, the
compiler won't emit std::span<char>::span<char&[N1]> symbol as it should

```
#include <span>

struct byte_writer: std::span<char> {
    using std::span<char>::span;
        //byte_writer(auto && arg): std::span<char>{arg} { }
        constexpr void do_something() noexcept {
                (void)this->empty();
        }
};

int main() {
        char array[1];
        auto writer = byte_writer{array};
        writer.do_something();
}
```

if you explicitly use the constructor (commented out) it will emit the symbol,
also the symbol is emitted if `using std::span<char>::span;` is added to the
type.

https://compiler-explorer.com/z/q8z833eqd

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

end of thread, other threads:[~2022-03-28 19:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 15:10 [Bug c++/102045] New: constructor is not being instantiated hanicka at hanicka dot net
2021-08-24 15:17 ` [Bug c++/102045] " mpolacek at gcc dot gnu.org
2021-08-24 15:19 ` redi at gcc dot gnu.org
2021-08-24 15:22 ` redi at gcc dot gnu.org
2021-08-24 15:22 ` [Bug c++/102045] [11/12 regression] " redi at gcc dot gnu.org
2021-08-24 17:07 ` ppalka at gcc dot gnu.org
2021-08-25  7:39 ` rguenth at gcc dot gnu.org
2022-03-27  0:24 ` jason at gcc dot gnu.org
2022-03-27  3:24 ` jason at gcc dot gnu.org
2022-03-28 13:37 ` cvs-commit at gcc dot gnu.org
2022-03-28 19:13 ` [Bug c++/102045] [11 " cvs-commit at gcc dot gnu.org
2022-03-28 19:15 ` 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).