[Bug c++/99377] [modules] undefined std::string_view::empty() if referenced in inline exported function

johelegp at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Jul 16 17:33:32 GMT 2022


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

--- Comment #12 from Johel Ernesto Guerrero Peña <johelegp at gmail dot com> ---
The workaround of Comment 5 stopped working for my actual use-case some time
ago. Now I do this:

```C++
export constexpr void expects(bool truth) noexcept {
  if (not truth) std::terminate();
}

// Workarounds GCC bug 99377.
export constexpr auto expects2 = expects;
```

FWIW, I've attached the debug and release `.gcm` and `.o` (without the
workaround above), which might hint as to what's (not) happening.


More information about the Gcc-bugs mailing list