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

Reply via email to