@@ -8728,19 +8728,28 @@ void ClangImporter::Implementation::importAttributes(
87288728 // Prime the lexer.
87298729 parser.consumeTokenWithoutFeedingReceiver ();
87308730
8731+ bool hadError = false ;
87318732 SourceLoc atLoc;
87328733 if (parser.consumeIf (tok::at_sign, atLoc)) {
8733- ( void ) parser.parseDeclAttribute (
8734+ hadError = parser.parseDeclAttribute (
87348735 MappedDecl->getAttrs (), atLoc, initContext,
8735- /* isFromClangAttribute=*/ true );
8736+ /* isFromClangAttribute=*/ true ). isError () ;
87368737 } else {
8737- // Complain about the missing '@'.
8738+ SourceLoc staticLoc;
8739+ StaticSpellingKind staticSpelling;
8740+ hadError = parser.parseDeclModifierList (
8741+ MappedDecl->getAttrs (), staticLoc, staticSpelling,
8742+ /* isFromClangAttribute=*/ true );
8743+ }
8744+
8745+ if (hadError) {
8746+ // Complain about the unhandled attribute or modifier.
87388747 auto &clangSrcMgr = getClangASTContext ().getSourceManager ();
87398748 ClangSourceBufferImporter &bufferImporter =
87408749 getBufferImporterForDiagnostics ();
87418750 SourceLoc attrLoc = bufferImporter.resolveSourceLocation (
87428751 clangSrcMgr, swiftAttr->getLocation ());
8743- diagnose (attrLoc, diag::clang_swift_attr_without_at ,
8752+ diagnose (attrLoc, diag::clang_swift_attr_unhandled ,
87448753 swiftAttr->getAttribute ());
87458754 }
87468755 continue ;
0 commit comments