mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-12 21:28:48 +00:00
Fix parsing of classes where the class name is an absolute nested name specifier.
llvm-svn: 214393
This commit is contained in:
parent
87c046189d
commit
45bf56cdf9
@ -1327,10 +1327,8 @@ void UnwrappedLineParser::parseEnum() {
|
||||
|
||||
void UnwrappedLineParser::parseRecord() {
|
||||
nextToken();
|
||||
if (FormatTok->Tok.is(tok::identifier) ||
|
||||
FormatTok->Tok.is(tok::kw___attribute) ||
|
||||
FormatTok->Tok.is(tok::kw___declspec) ||
|
||||
FormatTok->Tok.is(tok::kw_alignas)) {
|
||||
if (FormatTok->isOneOf(tok::identifier, tok::coloncolon, tok::kw___attribute,
|
||||
tok::kw___declspec, tok::kw_alignas)) {
|
||||
nextToken();
|
||||
// We can have macros or attributes in between 'class' and the class name.
|
||||
if (FormatTok->Tok.is(tok::l_paren)) {
|
||||
|
@ -1846,6 +1846,7 @@ TEST_F(FormatTest, FormatsClasses) {
|
||||
verifyFormat("template <class R, class C>\n"
|
||||
"struct Aaaaaaaaaaaaaaaaa<R (C::*)(int) const>\n"
|
||||
" : Aaaaaaaaaaaaaaaaa<R (C::*)(int)> {};");
|
||||
verifyFormat("class ::A::B {};");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, FormatsVariableDeclarationsAfterStructOrClass) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user