[clang-cl] Handle some pragma alloc_text corner cases handled by MSVC
authorStephen Long <steplong@quicinc.com>
Tue, 28 Jun 2022 13:45:18 +0000 (06:45 -0700)
committerStephen Long <steplong@quicinc.com>
Wed, 29 Jun 2022 13:45:59 +0000 (06:45 -0700)
commitf382545b2ba8a39435f7efa02dadc722c429d2cd
treeb889896f236fc080ae423f85a988c462bbca0193
parent7758f3aa9683118681be79a7379d38f5effefd87
[clang-cl] Handle some pragma alloc_text corner cases handled by MSVC

MSVC's pragma alloc_text accepts a function that was redeclared in
a non extern-C context if the previous declaration was in an extern-C
context. i.e.

```
extern "C" { static void f(); }
static void f();
```

MSVC's pragma alloc_text also rejects non-functions.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D128649
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaAttr.cpp
clang/test/Sema/pragma-ms-alloc-text.c
clang/test/Sema/pragma-ms-alloc-text.cpp