PR45267: Don't reject pure-specifiers with escaped newlines in their '0' token.

This commit is contained in:
Richard Smith 2020-03-20 18:44:13 -07:00
parent 09c8845adf
commit ced7617c38
2 changed files with 4 additions and 2 deletions

View File

@ -2670,7 +2670,7 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
auto &Zero = NextToken();
SmallString<8> Buffer;
if (Zero.isNot(tok::numeric_constant) || Zero.getLength() != 1 ||
if (Zero.isNot(tok::numeric_constant) ||
PP.getSpelling(Zero, Buffer) != "0")
return false;

View File

@ -37,6 +37,8 @@ public:
virtual int vf5a(){0;}; // function definition, expected-warning {{unused}}
virtual int vf6()(0); // expected-error +{{}} expected-note +{{}}
virtual int vf7() = { 0 }; // expected-error {{does not look like a pure-specifier}}
virtual int PR45267() = \
0; // ok, despite escaped newline
private:
int x,f(),y,g();