generators: Escape C++20 keywords and the assert macro in names


The list of names the generators suffix with '_' predates C++11, so a
field named 'concept' or 'requires' generated a header that no compiler
accepts:

    void setRequires(const QStringList &requires);
    void setConcept_p(QString concept);

Both names appear in the upstream conformance suite, which is how this
surfaced. Add the ten keywords protoc's own list carries and we lacked:
char8_t, char16_t, char32_t, concept, consteval, constinit, co_await,
co_return, co_yield and requires. 'assert' is the remaining name protoc
escapes and we did not; being a function-like macro it expands in the
generated getter declaration and breaks the header the same way.

protoc's list, in the release the conformance suite pins:
https://github.com/protocolbuffers/protobuf/blob/v31.1/src/google/protobuf/compiler/cpp/helpers.cc#L120-L217

The underscore-carrying keywords cannot reach a field name. QtProtobuf's
camel-cases ('co_await' -> 'coAwait') resolves that, but they do reach
enum value names, which are escaped through the same helper.

Fixes: QTBUG-150065
Pick-to: 6.12 6.11 6.8
Change-Id: I2de72899002d3ccb8ee32706190b42490b841bad
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commit02b524d8e88232013409f530277c490e8de69ba7
parent55273434ca4c1b723afc47477c9617db9801a46c
authorDennis Oberst <dennis.oberst@qt.io>
committerDennis Oberst <dennis.oberst@qt.io>
commit timeWed, 14 Oct 2026 09:24:22 +0000