Reproducer:
export module a.dwaldjlaiwjdwiajdilawjdliwajdlwajdlwajdijawldjawljdlwajdlawjdlajhwldijawildjwalidjawlijdlwaijdilawjdilwajdilwahgfliuehluksebvilu;
And let's format it:
$ bin/clang-format a.cppm -i
$ cat a.cppm
export module a
.dwaldjlaiwjdwiajdilawjdliwajdlwajdlwajdijawldjawljdlwajdlawjdlajhwldijawildjwalidjawlijdlwaijdilawjdilwajdilwahgfliuehluksebvilu;
then clang will reject it: https://godbolt.org/z/T1z49caj8
error: unexpected preprocessing token '.' after module name, only ';' and '[' (start of attribute specifier sequence) are allowed
This is somewhat problematic as in practice it is possible to have long module name. (It is annoying to say "ISO C++ disallows long module name".
And I am not sure how can we fix this. Should we ask clang-format to not format module name?
BTW, import a long module name seems to have a similar problem.
Reproducer:
And let's format it:
then clang will reject it: https://godbolt.org/z/T1z49caj8
This is somewhat problematic as in practice it is possible to have long module name. (It is annoying to say "ISO C++ disallows long module name".
And I am not sure how can we fix this. Should we ask clang-format to not format module name?
BTW, import a long module name seems to have a similar problem.