[MS] Accept __unaligned as a qualifier on member function pointers

We need to treat __unaligned like the other 'cvr' qualifiers when it
appears at the end of a function prototype. We weren't doing that in
some tentative parsing.

Fixes PR36638.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326962 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner 2018-03-07 23:26:02 +00:00
parent 551ca2e6b7
commit fd8a50c030
2 changed files with 9 additions and 1 deletions

View File

@ -1894,7 +1894,8 @@ Parser::TPResult Parser::TryParseFunctionDeclarator() {
return TPResult::Error;
// cv-qualifier-seq
while (Tok.isOneOf(tok::kw_const, tok::kw_volatile, tok::kw_restrict))
while (Tok.isOneOf(tok::kw_const, tok::kw_volatile, tok::kw___unaligned,
tok::kw_restrict))
ConsumeToken();
// ref-qualifier[opt]

View File

@ -424,3 +424,10 @@ struct S {
S(T);
} f([] {});
}
namespace pr36638 {
// Make sure we accept __unaligned method qualifiers on member function
// pointers.
struct A;
void (A::*mp1)(int) __unaligned;
}