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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |redi at gcc dot gnu.org
          Component|c++                         |libstdc++

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Thanks for confirming the crash reason.

So I wonder, quoting a small testcase:

#include <string>

struct RawCodePoint {
  const std::string original;
  const std::string normal;
  const std::string folded_case;
  const std::string swapped_case;
  bool is_letter;
  bool is_punctuation;
  bool is_uppercase;
  unsigned char break_property;
  unsigned char combining_class;
};

void foo() {
static const RawCodePoint code_points[] = {
{"\x00","\x00","\x00","\x00",0,0,0,3,0},
{"^A","^A","^A","^A",0,0,0,3,0},
{"^B","^B","^B","^B",0,0,0,3,0}
};
}

why with the new std::string and its small string optimization we cannot
"constexpr" the constructor (not sure what clang does here).

I suppose one issue is that the C++ FE arranges for the constructors to
throw and thus emits cleanups for others.

But in the end the testcase doesn't look unreasonable and we should do
better (constexpr evaluation should be able to tell whether we'll throw
as well).

So, another question to the reporter - does -fno-exceptions help
for your original testcase (the preprocessed one doesn't like
-fno-exceptions)?

Reply via email to