Closed
Description
Bugzilla Link | 49298 |
Version | trunk |
OS | Linux |
Reporter | LLVM Bugzilla Contributor |
Extended Description
clang-format does not respect raw string literals when sorting includes
Take this snippet:
const char *RawStr = R"(
#include "headerB.h"
#include "headerA.h"
)";
Running clang-format over with SortIncludes enabled transforms this code to:
const char *RawStr = R"(
#include "headerA.h"
#include "headerB.h"
)";
The formatter should not sort these includes as they are part of a raw string without a language delimiter.
The cause for this is pretty obvious, the include sorter runs without parsing the code, so it can't see that include tokens should actually be part of a string.