diff options
author | Reid Kleckner <rnk@google.com> | 2018-03-07 23:26:02 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-03-07 23:26:02 +0000 |
commit | c6663b7c45056e5bcd1894b11556d82c752114b4 (patch) | |
tree | 06926f27a3844384b204e9f202681661b00c3077 | |
parent | abdb3224386475aec79bbd3345c62d988e622ca7 (diff) | |
download | bcm5719-llvm-c6663b7c45056e5bcd1894b11556d82c752114b4.tar.gz bcm5719-llvm-c6663b7c45056e5bcd1894b11556d82c752114b4.zip |
[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.
llvm-svn: 326962
-rw-r--r-- | clang/lib/Parse/ParseTentative.cpp | 3 | ||||
-rw-r--r-- | clang/test/Parser/MicrosoftExtensions.cpp | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp index 88c0e176b02..ebd6f0f5b8e 100644 --- a/clang/lib/Parse/ParseTentative.cpp +++ b/clang/lib/Parse/ParseTentative.cpp @@ -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] diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index 21635f0ee12..8799f49df6c 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -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; +} |