better-cpp-syntax
better-cpp-syntax copied to clipboard
attribute in macro can break syntax highlighting
moved from https://github.com/clangd/clangd/issues/385
The code with a problem is:
#pragma once
#if 1
# define MACRO(attr) [[attr]]
#else
# define MACRO(attr)
#endif
struct S {
MACRO(deprecated("some unrecognized string size() some unrecognized string"))
int f() { return 0; }
};
It looks like:

vscode 1.45.0 without any cpp extension.
And another example here: https://github.com/microsoft/vscode-cpptools/issues/6560