diff options
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 7df9ed51804..9e5fa0e5634 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5975,7 +5975,7 @@ static void checkDLLAttributeRedeclaration(Sema &S, NamedDecl *OldDecl, NamedDecl *NewDecl, bool IsSpecialization, bool IsDefinition) { - if (OldDecl->isInvalidDecl()) + if (OldDecl->isInvalidDecl() || NewDecl->isInvalidDecl()) return; bool IsTemplate = false; @@ -6081,7 +6081,8 @@ static void checkDLLAttributeRedeclaration(Sema &S, NamedDecl *OldDecl, NewDecl->dropAttr<DLLImportAttr>(); } } else if (IsInline && OldImportAttr && !IsMicrosoft) { - // In MinGW, seeing a function declared inline drops the dllimport attribute. + // In MinGW, seeing a function declared inline drops the dllimport + // attribute. OldDecl->dropAttr<DLLImportAttr>(); NewDecl->dropAttr<DLLImportAttr>(); S.Diag(NewDecl->getLocation(), |

