{"action":"created","comment":{"url":"https://api.github.com/repos/dlang/dmd/pulls/comments/191058716","pull_request_review_id":123566802,"id":191058716,"diff_hunk":"@@ -684,22 +684,148 @@ private:\n             buf.writestring(\"?1\");\n             return;\n         }\n+        else if (sym.ident)\n+        {\n+            if (sym.ident.equals(Id.assign))\n+            {\n+                buf.writestring(\"?4\");\n+                return;\n+            }\n+            else if (sym.ident.equals(Id.eq))\n+            {\n+                buf.writestring(\"?8\");\n+                return;\n+            }\n+            else if (sym.ident.equals(Id.index))\n+            {\n+                buf.writestring(\"?A\");\n+                return;\n+            }\n+            else if (sym.ident.equals(Id.call))\n+            {\n+                buf.writestring(\"?R\");\n+                return;\n+            }\n+        }\n         if (TemplateInstance ti = sym.isTemplateInstance())\n         {\n+            auto id = ti.tempdecl.ident;\n+            const(char)* symName = id.toChars();\n+\n+            int firstTemplateArg = 0;\n+\n+            // test for special symbols\n+            import std.algorithm : countUntil;\n+            auto operators = [Id._cast, Id.assign, Id.eq, Id.index, Id.call, Id.opUnary, Id.opBinary, Id.opOpAssign];\n+            sizediff_t whichOp = operators.countUntil!((o, n) => n.equals(o))(ti.name);\n+            switch (whichOp)\n+            {\n+                case -1:\n+                    break;\n+                case 0: // opCast\n+                    buf.writestring(\"?B\");\n+                    return;\n+                case 1: // opAssign\n+                    symName = \"?4\";\n+                    break;\n+                case 2: // opEquals\n+                    symName = \"?8\";\n+                    break;\n+                case 3: // opIndex\n+                    symName = \"?A\";\n+                    break;\n+                case 4: // opCall\n+                    symName = \"?R\";\n+                    break;\n+                case 5:\n+                ..\n+                case 7: // opUnary, opBinary, opOpAssign\n+                    if (ti.tiargs.dim < 1)\n+                        break; // perhaps this is assert? those operators shouldn't have 0 args!\n+                    TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration();\n+                    assert(td);\n+                    TemplateParameter tp = (*td.parameters)[0];\n+                    TemplateValueParameter tv = tp.isTemplateValueParameter();\n+                    if (!tv || !tv.valType.isString())\n+                        break; // expecting a string argument to operators!\n+                    Expression exp = (*ti.tiargs)[0].isExpression();\n+                    StringExp str = exp.toStringExp();\n+                    switch (whichOp)\n+                    {\n+                        case 5: // opUnary\n+                            switch (str.peekSlice)","path":"src/dmd/cppmanglewin.d","position":79,"original_position":73,"commit_id":"3aecd2e097248d8701c3b7989bd29881b5ff8d5f","original_commit_id":"9afe8f1440dca5ed22b52b08fb7e030e3dbaa0d2","user":{"login":"TurkeyMan","id":1146706,"avatar_url":"https://avatars0.githubusercontent.com/u/1146706?v=4","gravatar_id":"","url":"https://api.github.com/users/TurkeyMan","html_url":"https://github.com/TurkeyMan","followers_url":"https://api.github.com/users/TurkeyMan/followers","following_url":"https://api.github.com/users/TurkeyMan/following{/other_user}","gists_url":"https://api.github.com/users/TurkeyMan/gists{/gist_id}","starred_url":"https://api.github.com/users/TurkeyMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TurkeyMan/subscriptions","organizations_url":"https://api.github.com/users/TurkeyMan/orgs","repos_url":"https://api.github.com/users/TurkeyMan/repos","events_url":"https://api.github.com/users/TurkeyMan/events{/privacy}","received_events_url":"https://api.github.com/users/TurkeyMan/received_events","type":"User","site_admin":false},"body":"I still don't get it... `exp.op == TOK.string_`. The template arg to the operators is a string of the operator.","created_at":"2018-05-26T21:14:12Z","updated_at":"2018-05-26T21:14:12Z","html_url":"https://github.com/dlang/dmd/pull/8290#discussion_r191058716","pull_request_url":"https://api.github.com/repos/dlang/dmd/pulls/8290","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dlang/dmd/pulls/comments/191058716"},"html":{"href":"https://github.com/dlang/dmd/pull/8290#discussion_r191058716"},"pull_request":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8290"}},"in_reply_to_id":191042521},"pull_request":{"url":"https://api.github.com/repos/dlang/dmd/pulls/8290","id":190486537,"html_url":"https://github.com/dlang/dmd/pull/8290","diff_url":"https://github.com/dlang/dmd/pull/8290.diff","patch_url":"https://github.com/dlang/dmd/pull/8290.patch","issue_url":"https://api.github.com/repos/dlang/dmd/issues/8290","number":8290,"state":"open","locked":false,"title":"[WIP] Mangle all the C++ operators good and proper","user":{"login":"TurkeyMan","id":1146706,"avatar_url":"https://avatars0.githubusercontent.com/u/1146706?v=4","gravatar_id":"","url":"https://api.github.com/users/TurkeyMan","html_url":"https://github.com/TurkeyMan","followers_url":"https://api.github.com/users/TurkeyMan/followers","following_url":"https://api.github.com/users/TurkeyMan/following{/other_user}","gists_url":"https://api.github.com/users/TurkeyMan/gists{/gist_id}","starred_url":"https://api.github.com/users/TurkeyMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TurkeyMan/subscriptions","organizations_url":"https://api.github.com/users/TurkeyMan/orgs","repos_url":"https://api.github.com/users/TurkeyMan/repos","events_url":"https://api.github.com/users/TurkeyMan/events{/privacy}","received_events_url":"https://api.github.com/users/TurkeyMan/received_events","type":"User","site_admin":false},"body":"We can map the operators just fine, so let's.","created_at":"2018-05-25T05:40:33Z","updated_at":"2018-05-26T21:14:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc247d33606cc0aae7ad04cffa3cff9caa0f6aee","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":876579237,"url":"https://api.github.com/repos/dlang/dmd/labels/Vision","name":"Vision","color":"aafc07","default":false},{"id":639748221,"url":"https://api.github.com/repos/dlang/dmd/labels/WIP","name":"WIP","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dlang/dmd/pulls/8290/commits","review_comments_url":"https://api.github.com/repos/dlang/dmd/pulls/8290/comments","review_comment_url":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlang/dmd/issues/8290/comments","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/3aecd2e097248d8701c3b7989bd29881b5ff8d5f","head":{"label":"TurkeyMan:cpp_mangle_operators","ref":"cpp_mangle_operators","sha":"3aecd2e097248d8701c3b7989bd29881b5ff8d5f","user":{"login":"TurkeyMan","id":1146706,"avatar_url":"https://avatars0.githubusercontent.com/u/1146706?v=4","gravatar_id":"","url":"https://api.github.com/users/TurkeyMan","html_url":"https://github.com/TurkeyMan","followers_url":"https://api.github.com/users/TurkeyMan/followers","following_url":"https://api.github.com/users/TurkeyMan/following{/other_user}","gists_url":"https://api.github.com/users/TurkeyMan/gists{/gist_id}","starred_url":"https://api.github.com/users/TurkeyMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TurkeyMan/subscriptions","organizations_url":"https://api.github.com/users/TurkeyMan/orgs","repos_url":"https://api.github.com/users/TurkeyMan/repos","events_url":"https://api.github.com/users/TurkeyMan/events{/privacy}","received_events_url":"https://api.github.com/users/TurkeyMan/received_events","type":"User","site_admin":false},"repo":{"id":3764271,"name":"dmd","full_name":"TurkeyMan/dmd","owner":{"login":"TurkeyMan","id":1146706,"avatar_url":"https://avatars0.githubusercontent.com/u/1146706?v=4","gravatar_id":"","url":"https://api.github.com/users/TurkeyMan","html_url":"https://github.com/TurkeyMan","followers_url":"https://api.github.com/users/TurkeyMan/followers","following_url":"https://api.github.com/users/TurkeyMan/following{/other_user}","gists_url":"https://api.github.com/users/TurkeyMan/gists{/gist_id}","starred_url":"https://api.github.com/users/TurkeyMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TurkeyMan/subscriptions","organizations_url":"https://api.github.com/users/TurkeyMan/orgs","repos_url":"https://api.github.com/users/TurkeyMan/repos","events_url":"https://api.github.com/users/TurkeyMan/events{/privacy}","received_events_url":"https://api.github.com/users/TurkeyMan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TurkeyMan/dmd","description":"dmd D Programming Language compiler","fork":true,"url":"https://api.github.com/repos/TurkeyMan/dmd","forks_url":"https://api.github.com/repos/TurkeyMan/dmd/forks","keys_url":"https://api.github.com/repos/TurkeyMan/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TurkeyMan/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TurkeyMan/dmd/teams","hooks_url":"https://api.github.com/repos/TurkeyMan/dmd/hooks","issue_events_url":"https://api.github.com/repos/TurkeyMan/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/TurkeyMan/dmd/events","assignees_url":"https://api.github.com/repos/TurkeyMan/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/TurkeyMan/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/TurkeyMan/dmd/tags","blobs_url":"https://api.github.com/repos/TurkeyMan/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TurkeyMan/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TurkeyMan/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/TurkeyMan/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TurkeyMan/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/TurkeyMan/dmd/languages","stargazers_url":"https://api.github.com/repos/TurkeyMan/dmd/stargazers","contributors_url":"https://api.github.com/repos/TurkeyMan/dmd/contributors","subscribers_url":"https://api.github.com/repos/TurkeyMan/dmd/subscribers","subscription_url":"https://api.github.com/repos/TurkeyMan/dmd/subscription","commits_url":"https://api.github.com/repos/TurkeyMan/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/TurkeyMan/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/TurkeyMan/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/TurkeyMan/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/TurkeyMan/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/TurkeyMan/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TurkeyMan/dmd/merges","archive_url":"https://api.github.com/repos/TurkeyMan/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TurkeyMan/dmd/downloads","issues_url":"https://api.github.com/repos/TurkeyMan/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/TurkeyMan/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/TurkeyMan/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/TurkeyMan/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TurkeyMan/dmd/labels{/name}","releases_url":"https://api.github.com/repos/TurkeyMan/dmd/releases{/id}","deployments_url":"https://api.github.com/repos/TurkeyMan/dmd/deployments","created_at":"2012-03-19T13:59:05Z","updated_at":"2018-05-22T03:57:07Z","pushed_at":"2018-05-26T21:05:59Z","git_url":"git://github.com/TurkeyMan/dmd.git","ssh_url":"git@github.com:TurkeyMan/dmd.git","clone_url":"https://github.com/TurkeyMan/dmd.git","svn_url":"https://github.com/TurkeyMan/dmd","homepage":"d-programming-language.org","size":83614,"stargazers_count":1,"watchers_count":1,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"dlang:master","ref":"master","sha":"1805141e3848adbf57edac8a0c0e80e99c7ee405","user":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"repo":{"id":1257070,"name":"dmd","full_name":"dlang/dmd","owner":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dlang/dmd","description":"dmd D Programming Language compiler","fork":false,"url":"https://api.github.com/repos/dlang/dmd","forks_url":"https://api.github.com/repos/dlang/dmd/forks","keys_url":"https://api.github.com/repos/dlang/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlang/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlang/dmd/teams","hooks_url":"https://api.github.com/repos/dlang/dmd/hooks","issue_events_url":"https://api.github.com/repos/dlang/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/dlang/dmd/events","assignees_url":"https://api.github.com/repos/dlang/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/dlang/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/dlang/dmd/tags","blobs_url":"https://api.github.com/repos/dlang/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlang/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlang/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlang/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/dlang/dmd/languages","stargazers_url":"https://api.github.com/repos/dlang/dmd/stargazers","contributors_url":"https://api.github.com/repos/dlang/dmd/contributors","subscribers_url":"https://api.github.com/repos/dlang/dmd/subscribers","subscription_url":"https://api.github.com/repos/dlang/dmd/subscription","commits_url":"https://api.github.com/repos/dlang/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlang/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlang/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlang/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlang/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/dlang/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlang/dmd/merges","archive_url":"https://api.github.com/repos/dlang/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlang/dmd/downloads","issues_url":"https://api.github.com/repos/dlang/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/dlang/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/dlang/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/dlang/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlang/dmd/labels{/name}","releases_url":"https://api.github.com/repos/dlang/dmd/releases{/id}","deployments_url":"https://api.github.com/repos/dlang/dmd/deployments","created_at":"2011-01-15T06:53:53Z","updated_at":"2018-05-26T13:05:55Z","pushed_at":"2018-05-26T21:06:02Z","git_url":"git://github.com/dlang/dmd.git","ssh_url":"git@github.com:dlang/dmd.git","clone_url":"https://github.com/dlang/dmd.git","svn_url":"https://github.com/dlang/dmd","homepage":"dlang.org","size":89323,"stargazers_count":1795,"watchers_count":1795,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":451,"mirror_url":null,"archived":false,"open_issues_count":141,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0"},"forks":451,"open_issues":141,"watchers":1795,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8290"},"html":{"href":"https://github.com/dlang/dmd/pull/8290"},"issue":{"href":"https://api.github.com/repos/dlang/dmd/issues/8290"},"comments":{"href":"https://api.github.com/repos/dlang/dmd/issues/8290/comments"},"review_comments":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8290/comments"},"review_comment":{"href":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8290/commits"},"statuses":{"href":"https://api.github.com/repos/dlang/dmd/statuses/3aecd2e097248d8701c3b7989bd29881b5ff8d5f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"TurkeyMan"}}