Can you please review a fix for assertion fail on the following small test:
typedef int td3;
#pragma weak td3 = td3
Assertion failed: (isa<FunctionDecl>(ND) || isa<VarDecl>(ND)), function DeclClonePragmaWeak, file /export/bpart/users/amusman/workspaces/blib16/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp, line 5337.
Call stack:
frame #4: 0x0000000103e2eb61 clang`__assert_rtn(func=0x0000000103f0dec0, file=0x0000000103f0dd75, line=5337, expr=0x0000000103f0ded4) + 129 at Signals.inc:537 frame #5: 0x0000000100d6b5da clang`clang::Sema::DeclClonePragmaWeak(this=0x000000010a051a00, ND=0x000000010a030810, II=0x000000010a0720d0, Loc=SourceLocation at 0x00007fff5fbf93d0) + 170 at SemaDeclAttr.cpp:5337 frame #6: 0x0000000100d6bbd5 clang`clang::Sema::DeclApplyPragmaWeak(this=0x000000010a051a00, S=0x0000000109b112f0, ND=0x000000010a030810, W=0x00007fff5fbf95e8) + 181 at SemaDeclAttr.cpp:5388 frame #7: 0x0000000100d43397 clang`clang::Sema::ActOnPragmaWeakAlias(this=0x000000010a051a00, Name=0x000000010a0720d0, AliasName=0x000000010a072068, PragmaLoc=SourceLocation at 0x00007fff5fbf9638, NameLoc=SourceLocation at 0x00007fff5fbf9630, AliasNameLoc=SourceLocation at 0x00007fff5fbf9628) + 295 at SemaDecl.cpp:14221 frame #8: 0x000000010098e6d5 clang`clang::Parser::HandlePragmaWeakAlias(this=0x000000010a053a00) + 261 at ParsePragma.cpp:433 frame #9: 0x00000001009c152e clang`clang::Parser::ParseExternalDeclaration(this=0x000000010a053a00, attrs=0x00007fff5fbf99d8, DS=0x0000000000000000) + 1790 at Parser.cpp:702 frame #10: 0x00000001009c0de7 clang`clang::Parser::ParseTopLevelDecl(this=0x000000010a053a00, Result=0x00007fff5fbf9b00) + 743 at Parser.cpp:572 frame #11: 0x000000010090d45d clang`clang::ParseAST(S=0x000000010a051a00, PrintStats=false, SkipFunctionBodies=false) + 989 at ParseAST.cpp:144 frame #12: 0x000000010017262f clang`clang::ASTFrontendAction::ExecuteAction(this=0x0000000109b090a0) + 511 at FrontendAction.cpp:537 frame #13: 0x0000000100171bc0 clang`clang::FrontendAction::Execute(this=0x0000000109b090a0) + 112 at FrontendAction.cpp:439 frame #14: 0x0000000100101865 clang`clang::CompilerInstance::ExecuteAction(this=0x0000000109b084e0, Act=0x0000000109b090a0) + 997 at CompilerInstance.cpp:806 frame #15: 0x0000000100020cbe clang`clang::ExecuteCompilerInvocation(Clang=0x0000000109b084e0) + 3246 at ExecuteCompilerInvocation.cpp:318 frame #16: 0x0000000100001449 clang`cc1_main(Argv=ArrayRef<const char *> at 0x00007fff5fbfa6a8, Argv0=0x00007fff5fbfd1b8, MainAddr=0x00000001000149f0) + 2473 at cc1_main.cpp:110 frame #17: 0x0000000100016133 clang`ExecuteCC1Tool(argv=ArrayRef<const char *> at 0x00007fff5fbfb168, Tool=StringRef at 0x00007fff5fbfb158) + 163 at driver.cpp:369 frame #18: 0x0000000100014fb5 clang`main(argc_=3, argv_=0x00007fff5fbfc9c8) + 1269 at driver.cpp:415
Should be "'weak'" instead of "weak" so that the diagnostic is properly quoted for the user.