{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift-clang/pulls/comments/51632605","id":51632605,"diff_hunk":"@@ -4057,6 +4057,38 @@ static void handleObjCRequiresSuperAttr(Sema &S, Decl *D,\n                                         attr.getAttributeSpellingListIndex()));\n }\n \n+static void handleNSErrorDomain(Sema &S, Decl *D, const AttributeList &Attr) {\n+  if (!isa<TagDecl>(D)) {\n+    S.Diag(D->getLocStart(), diag::err_nserrordomain_not_tagdecl);\n+    return;\n+  }\n+  IdentifierLoc *identLoc =\n+      Attr.isArgIdent(0) ? Attr.getArgAsIdent(0) : nullptr;\n+  if (!identLoc || !identLoc->Ident) {\n+    // Try to locate the argument directly\n+    SourceLocation loc = Attr.getLoc();\n+    if (Attr.isArgExpr(0) && Attr.getArgAsExpr(0))\n+      loc = Attr.getArgAsExpr(0)->getLocStart();\n+\n+    S.Diag(loc, diag::err_nserrordomain_requires_identifier);\n+    return;\n+  }\n+\n+  // Verify that the identifier is a valid decl in the C decl namespace\n+  LookupResult lookupResult(S, DeclarationName(identLoc->Ident),\n+                            SourceLocation(),\n+                            Sema::LookupNameKind::LookupOrdinaryName);\n+  if (!S.LookupName(lookupResult, S.TUScope)) {\n+    S.Diag(identLoc->Loc, diag::err_nserrordomain_invalid_decl)\n+        << identLoc->Ident;\n+    return;\n+  }\n+","path":"lib/Sema/SemaDeclAttr.cpp","position":30,"original_position":30,"commit_id":"85d4ce9d83bd0c164c3302e88aa5574bdcdaf1eb","original_commit_id":"85d4ce9d83bd0c164c3302e88aa5574bdcdaf1eb","user":{"login":"DougGregor","id":989428,"avatar_url":"https://avatars.githubusercontent.com/u/989428?v=3","gravatar_id":"","url":"https://api.github.com/users/DougGregor","html_url":"https://github.com/DougGregor","followers_url":"https://api.github.com/users/DougGregor/followers","following_url":"https://api.github.com/users/DougGregor/following{/other_user}","gists_url":"https://api.github.com/users/DougGregor/gists{/gist_id}","starred_url":"https://api.github.com/users/DougGregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DougGregor/subscriptions","organizations_url":"https://api.github.com/users/DougGregor/orgs","repos_url":"https://api.github.com/users/DougGregor/repos","events_url":"https://api.github.com/users/DougGregor/events{/privacy}","received_events_url":"https://api.github.com/users/DougGregor/received_events","type":"User","site_admin":false},"body":"Okay, that's fine","created_at":"2016-02-02T20:49:23Z","updated_at":"2016-02-02T20:49:23Z","html_url":"https://github.com/apple/swift-clang/pull/3#discussion_r51632605","pull_request_url":"https://api.github.com/repos/apple/swift-clang/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/apple/swift-clang/pulls/comments/51632605"},"html":{"href":"https://github.com/apple/swift-clang/pull/3#discussion_r51632605"},"pull_request":{"href":"https://api.github.com/repos/apple/swift-clang/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift-clang/pulls/3","id":57924934,"html_url":"https://github.com/apple/swift-clang/pull/3","diff_url":"https://github.com/apple/swift-clang/pull/3.diff","patch_url":"https://github.com/apple/swift-clang/pull/3.patch","issue_url":"https://api.github.com/repos/apple/swift-clang/issues/3","number":3,"state":"closed","locked":false,"title":"Introduce ns_error_domain attribute.","user":{"login":"milseman","id":235334,"avatar_url":"https://avatars.githubusercontent.com/u/235334?v=3","gravatar_id":"","url":"https://api.github.com/users/milseman","html_url":"https://github.com/milseman","followers_url":"https://api.github.com/users/milseman/followers","following_url":"https://api.github.com/users/milseman/following{/other_user}","gists_url":"https://api.github.com/users/milseman/gists{/gist_id}","starred_url":"https://api.github.com/users/milseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milseman/subscriptions","organizations_url":"https://api.github.com/users/milseman/orgs","repos_url":"https://api.github.com/users/milseman/repos","events_url":"https://api.github.com/users/milseman/events{/privacy}","received_events_url":"https://api.github.com/users/milseman/received_events","type":"User","site_admin":false},"body":"ns_error_domain can be used by, e.g. NS_ERROR_ENUM, in order to\r\nidentify a global declaration representing the domain constant.\r\n\r\nIntroduces the attribute, Sema handling, diagnostics, and test case.","created_at":"2016-02-02T00:51:01Z","updated_at":"2016-02-02T20:49:23Z","closed_at":"2016-02-02T19:54:21Z","merged_at":null,"merge_commit_sha":"6e97b0c4363e40f76b687e249de4265986052088","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift-clang/pulls/3/commits","review_comments_url":"https://api.github.com/repos/apple/swift-clang/pulls/3/comments","review_comment_url":"https://api.github.com/repos/apple/swift-clang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift-clang/issues/3/comments","statuses_url":"https://api.github.com/repos/apple/swift-clang/statuses/85d4ce9d83bd0c164c3302e88aa5574bdcdaf1eb","head":{"label":"milseman:error_enum","ref":"error_enum","sha":"85d4ce9d83bd0c164c3302e88aa5574bdcdaf1eb","user":{"login":"milseman","id":235334,"avatar_url":"https://avatars.githubusercontent.com/u/235334?v=3","gravatar_id":"","url":"https://api.github.com/users/milseman","html_url":"https://github.com/milseman","followers_url":"https://api.github.com/users/milseman/followers","following_url":"https://api.github.com/users/milseman/following{/other_user}","gists_url":"https://api.github.com/users/milseman/gists{/gist_id}","starred_url":"https://api.github.com/users/milseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milseman/subscriptions","organizations_url":"https://api.github.com/users/milseman/orgs","repos_url":"https://api.github.com/users/milseman/repos","events_url":"https://api.github.com/users/milseman/events{/privacy}","received_events_url":"https://api.github.com/users/milseman/received_events","type":"User","site_admin":false},"repo":{"id":50699264,"name":"swift-clang","full_name":"milseman/swift-clang","owner":{"login":"milseman","id":235334,"avatar_url":"https://avatars.githubusercontent.com/u/235334?v=3","gravatar_id":"","url":"https://api.github.com/users/milseman","html_url":"https://github.com/milseman","followers_url":"https://api.github.com/users/milseman/followers","following_url":"https://api.github.com/users/milseman/following{/other_user}","gists_url":"https://api.github.com/users/milseman/gists{/gist_id}","starred_url":"https://api.github.com/users/milseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milseman/subscriptions","organizations_url":"https://api.github.com/users/milseman/orgs","repos_url":"https://api.github.com/users/milseman/repos","events_url":"https://api.github.com/users/milseman/events{/privacy}","received_events_url":"https://api.github.com/users/milseman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/milseman/swift-clang","description":"","fork":true,"url":"https://api.github.com/repos/milseman/swift-clang","forks_url":"https://api.github.com/repos/milseman/swift-clang/forks","keys_url":"https://api.github.com/repos/milseman/swift-clang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/milseman/swift-clang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/milseman/swift-clang/teams","hooks_url":"https://api.github.com/repos/milseman/swift-clang/hooks","issue_events_url":"https://api.github.com/repos/milseman/swift-clang/issues/events{/number}","events_url":"https://api.github.com/repos/milseman/swift-clang/events","assignees_url":"https://api.github.com/repos/milseman/swift-clang/assignees{/user}","branches_url":"https://api.github.com/repos/milseman/swift-clang/branches{/branch}","tags_url":"https://api.github.com/repos/milseman/swift-clang/tags","blobs_url":"https://api.github.com/repos/milseman/swift-clang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/milseman/swift-clang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/milseman/swift-clang/git/refs{/sha}","trees_url":"https://api.github.com/repos/milseman/swift-clang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/milseman/swift-clang/statuses/{sha}","languages_url":"https://api.github.com/repos/milseman/swift-clang/languages","stargazers_url":"https://api.github.com/repos/milseman/swift-clang/stargazers","contributors_url":"https://api.github.com/repos/milseman/swift-clang/contributors","subscribers_url":"https://api.github.com/repos/milseman/swift-clang/subscribers","subscription_url":"https://api.github.com/repos/milseman/swift-clang/subscription","commits_url":"https://api.github.com/repos/milseman/swift-clang/commits{/sha}","git_commits_url":"https://api.github.com/repos/milseman/swift-clang/git/commits{/sha}","comments_url":"https://api.github.com/repos/milseman/swift-clang/comments{/number}","issue_comment_url":"https://api.github.com/repos/milseman/swift-clang/issues/comments{/number}","contents_url":"https://api.github.com/repos/milseman/swift-clang/contents/{+path}","compare_url":"https://api.github.com/repos/milseman/swift-clang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/milseman/swift-clang/merges","archive_url":"https://api.github.com/repos/milseman/swift-clang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/milseman/swift-clang/downloads","issues_url":"https://api.github.com/repos/milseman/swift-clang/issues{/number}","pulls_url":"https://api.github.com/repos/milseman/swift-clang/pulls{/number}","milestones_url":"https://api.github.com/repos/milseman/swift-clang/milestones{/number}","notifications_url":"https://api.github.com/repos/milseman/swift-clang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/milseman/swift-clang/labels{/name}","releases_url":"https://api.github.com/repos/milseman/swift-clang/releases{/id}","deployments_url":"https://api.github.com/repos/milseman/swift-clang/deployments","created_at":"2016-01-29T23:53:05Z","updated_at":"2016-01-29T23:53:24Z","pushed_at":"2016-02-02T19:54:44Z","git_url":"git://github.com/milseman/swift-clang.git","ssh_url":"git@github.com:milseman/swift-clang.git","clone_url":"https://github.com/milseman/swift-clang.git","svn_url":"https://github.com/milseman/swift-clang","homepage":null,"size":94551,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"stable"}},"base":{"label":"apple:stable","ref":"stable","sha":"f66c5bb67b9a1016b51d2eff0f497d4528dacc0a","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":45423447,"name":"swift-clang","full_name":"apple/swift-clang","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift-clang","description":"","fork":false,"url":"https://api.github.com/repos/apple/swift-clang","forks_url":"https://api.github.com/repos/apple/swift-clang/forks","keys_url":"https://api.github.com/repos/apple/swift-clang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift-clang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift-clang/teams","hooks_url":"https://api.github.com/repos/apple/swift-clang/hooks","issue_events_url":"https://api.github.com/repos/apple/swift-clang/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift-clang/events","assignees_url":"https://api.github.com/repos/apple/swift-clang/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift-clang/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift-clang/tags","blobs_url":"https://api.github.com/repos/apple/swift-clang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift-clang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift-clang/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift-clang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift-clang/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift-clang/languages","stargazers_url":"https://api.github.com/repos/apple/swift-clang/stargazers","contributors_url":"https://api.github.com/repos/apple/swift-clang/contributors","subscribers_url":"https://api.github.com/repos/apple/swift-clang/subscribers","subscription_url":"https://api.github.com/repos/apple/swift-clang/subscription","commits_url":"https://api.github.com/repos/apple/swift-clang/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift-clang/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift-clang/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift-clang/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift-clang/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift-clang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift-clang/merges","archive_url":"https://api.github.com/repos/apple/swift-clang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift-clang/downloads","issues_url":"https://api.github.com/repos/apple/swift-clang/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift-clang/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift-clang/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift-clang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift-clang/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift-clang/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift-clang/deployments","created_at":"2015-11-02T21:31:45Z","updated_at":"2016-01-30T09:18:53Z","pushed_at":"2016-02-02T18:07:00Z","git_url":"git://github.com/apple/swift-clang.git","ssh_url":"git@github.com:apple/swift-clang.git","clone_url":"https://github.com/apple/swift-clang.git","svn_url":"https://github.com/apple/swift-clang","homepage":null,"size":94865,"stargazers_count":334,"watchers_count":334,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":0,"forks":56,"open_issues":0,"watchers":334,"default_branch":"stable"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift-clang/pulls/3"},"html":{"href":"https://github.com/apple/swift-clang/pull/3"},"issue":{"href":"https://api.github.com/repos/apple/swift-clang/issues/3"},"comments":{"href":"https://api.github.com/repos/apple/swift-clang/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift-clang/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift-clang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift-clang/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift-clang/statuses/85d4ce9d83bd0c164c3302e88aa5574bdcdaf1eb"}}}}