Skip to content
Snippets Groups Projects
Commit 751c0f0d authored by David Majnemer's avatar David Majnemer
Browse files

Sema: Simplify checkAttributesAfterMerging

Use getDLLAttr to factor out some common dllimport/dllexport code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219048 91177308-0d34-0410-b5e6-96231b3b80d8
parent 700b7e50
No related branches found
No related tags found
No related merge requests found
......@@ -5103,14 +5103,7 @@ static void checkAttributesAfterMerging(Sema &S, NamedDecl &ND) {
}
 
// dll attributes require external linkage.
if (const DLLImportAttr *Attr = ND.getAttr<DLLImportAttr>()) {
if (!ND.isExternallyVisible()) {
S.Diag(ND.getLocation(), diag::err_attribute_dll_not_extern)
<< &ND << Attr;
ND.setInvalidDecl();
}
}
if (const DLLExportAttr *Attr = ND.getAttr<DLLExportAttr>()) {
if (const InheritableAttr *Attr = getDLLAttr(&ND)) {
if (!ND.isExternallyVisible()) {
S.Diag(ND.getLocation(), diag::err_attribute_dll_not_extern)
<< &ND << Attr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment