[clang] Handle __declspec() attributes in using
authorTobias Hieta <tobias@hieta.se>
Thu, 9 Feb 2023 09:53:39 +0000 (10:53 +0100)
committerTobias Hieta <tobias@hieta.se>
Mon, 13 Feb 2023 14:43:08 +0000 (15:43 +0100)
commit877859a09bda29fe9a7f1a9016b06cf80661a032
treee2ee928e8cf10680867240a0da271b1891ade350
parenta01edb169bb06c2091b6c9fe6d7a9f07fc673766
[clang] Handle __declspec() attributes in using

This patch fixes so that declspec attributes are forwarded
to the alias declaration.

Before this patch this would assert:

class Test { int a; };
using AlignedTest = __declspec(align(16)) const Test;
static_assert(alignof(AlignedTest) == 16, "error");

But afterwards it behaves the same as MSVC does and doesn't
assert.

Fixes: llvm/llvm-project#60513

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D143632
clang/docs/ReleaseNotes.rst
clang/lib/Parse/ParseDecl.cpp
clang/test/SemaCXX/using-declspec.cpp [new file with mode: 0644]