<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75869>75869</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format Syntax errors after refactoring
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
LinZhihao-723
</td>
</tr>
</table>
<pre>
When using clang-format to refactor the code, it generates a syntax error.
clang-format version: 16.0.6 (Ubuntu, installed using `pip`)
File to refactor: https://github.com/LinZhihao-723/clp/blob/cb6058c8513a566ef8b7c70f31584f843c20492e/components/core/src/compressor_frontend/Constants.hpp
clang-formt settings: https://github.com/LinZhihao-723/clp/blob/cb6058c8513a566ef8b7c70f31584f843c20492e/components/core/.clang-format
clang-format output:
```
#ifndef COMPRESSOR_FRONTEND_CONSTANTS_HPP
#define COMPRESSOR_FRONTEND_CONSTANTS_HPP
#include <cstdint>
namespace compressor_frontend {
typedef std::pair<uint32_t, uint32_t> Interval;
constexpr uint32_t cUnicodeMax = 0x10'FFFF;
constexpr uint32_t cSizeOfByte = 256;
constexpr uint32_t cSizeOfAllChildren = 10'000;
constexpr uint32_t cNullSymbol = 10'000'000;
enum class SymbolID {
TokenEndID,
TokenUncaughtStringID,
TokenIntId,
TokenFloatId,
TokenFirstTimestampId,
TokenNewlineTimestampId,
TokenNewlineId
};
constexpr char cTokenEnd[] = "$end";
constexpr char cTokenUncaughtString[] = "$UncaughtString";
constexpr char cTokenInt[] = "int";
constexpr char cTokenFloat[] = "float";
constexpr char cTokenFirstTimestamp[] = "firstTimestamp";
constexpr char cTokenNewlineTimestamp[] = "newLineTimestamp";
constexpr char cTokenNewline[] = "newLine";
constexpr uint32_t cStaticByteBuffSize = 60'000;
namespace utf8 {
// 0xC0, 0xC1, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF are invalid
// UTF-8 code units
static const uint32_t cError = 0xFE;
stunsigned char const char cCharEOF = 0xFF;
}; // namespace utf8
} // namespace compressor_frontend
#endif // COMPRESSOR_FRONTEND_CONSTANTS_HPP
```
Error detected: `static const unsigned char cCharEOF = 0xFF;` -> `stunsigned char const char cCharEOF = 0xFF;`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVl1v6jgT_jXmxgIZ54NwwQUNRC_SOVAVqlfam8qxJ8S7xolsp4fur185SSlp2bbnaiXEJJl5nsyMMx_MWnnUAAsU3aFoNWKNKyuz-CH1H6UsWTWe0WCUV-Jl8f8SNG6s1EfMFdPHcVGZE3PYVdhAwbirDHYlYF4JQDTF0uEjaDDMgcUM2xft2BmDMZWZILJCZNn9D8iewVhZaRQs8TSekEmMEU0e80a7puXU1jGlQPSOoJjUskYxQXTesWVSwbVLnql0rrYoWCKaIZodpSubfMKrE6LZIE5EM65qRLNcVbm_yWMSJTyJpgGL4hiKJJ_xGSmCaZSERRIGnJJwTsGbVqe60qCdbW-Mf2YN7zUGrK3MU2Eq7UALRLO08pFoZydlXb_Pg8MWnJP6aP9D7yfX53LjpKrG1Y3zfnVnGZP-193SQBZaQIHT3c_7h_V-v3t4yh5228N6u3pKd9v9Ybk97J_-d39_AQgopIZvAy7v0Vw1AjAKUm6dkNqhYH1to9kJbM24_zQ_nAVGs7trY_dSg3fbOuFjC5Y1kwYFaSO1C-iT81_h5TpY4412YJ6ZQsGAhvvzhXNtLsaYP2rpa-MnO2MUrDA5TwmisyzLsgv4Fmwv_4ZdcffioIXRKP6G-VKptJRKGNAtqn0VIeRT6LZRav9yyis1xAyR3T_o5uT7gLW4g2xWb6nEGOND9RfotRabFaLpu8ePmrPmWLq9M1Ifry1a9Ua7jfiIylTFbiukse4gT2AdO9XXFq16C7-U1HDT4JWit9mIPsbZ6l8PlJfMYP4aXtc223whShEN2_qmN_J8hRvG_4Hinforto12QwpfAl-B2mQOYUX76EvgINnvGIa6r6jeH8yQTMOvH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