{"action":"created","issue":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/1227","labels_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1227/labels{/name}","comments_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1227/comments","events_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1227/events","html_url":"https://github.com/ldc-developers/ldc/pull/1227","id":120578080,"number":1227,"title":"Try to streamline generic x86 ABI","user":{"login":"kinke","id":1889215,"avatar_url":"https://avatars.githubusercontent.com/u/1889215?v=3","gravatar_id":"","url":"https://api.github.com/users/kinke","html_url":"https://github.com/kinke","followers_url":"https://api.github.com/users/kinke/followers","following_url":"https://api.github.com/users/kinke/following{/other_user}","gists_url":"https://api.github.com/users/kinke/gists{/gist_id}","starred_url":"https://api.github.com/users/kinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinke/subscriptions","organizations_url":"https://api.github.com/users/kinke/orgs","repos_url":"https://api.github.com/users/kinke/repos","events_url":"https://api.github.com/users/kinke/events{/privacy}","received_events_url":"https://api.github.com/users/kinke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-12-05T18:30:44Z","updated_at":"2015-12-07T05:30:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ldc-developers/ldc/pulls/1227","html_url":"https://github.com/ldc-developers/ldc/pull/1227","diff_url":"https://github.com/ldc-developers/ldc/pull/1227.diff","patch_url":"https://github.com/ldc-developers/ldc/pull/1227.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/comments/162415654","html_url":"https://github.com/ldc-developers/ldc/pull/1227#issuecomment-162415654","issue_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1227","id":162415654,"user":{"login":"smolt","id":919827,"avatar_url":"https://avatars.githubusercontent.com/u/919827?v=3","gravatar_id":"","url":"https://api.github.com/users/smolt","html_url":"https://github.com/smolt","followers_url":"https://api.github.com/users/smolt/followers","following_url":"https://api.github.com/users/smolt/following{/other_user}","gists_url":"https://api.github.com/users/smolt/gists{/gist_id}","starred_url":"https://api.github.com/users/smolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smolt/subscriptions","organizations_url":"https://api.github.com/users/smolt/orgs","repos_url":"https://api.github.com/users/smolt/repos","events_url":"https://api.github.com/users/smolt/events{/privacy}","received_events_url":"https://api.github.com/users/smolt/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T05:30:39Z","updated_at":"2015-12-07T05:30:39Z","body":"The failed test in runnable/cpp.d is D using sret on a C++ struct, while clang++ says to return directly in registers.  Its this function:\r\n```\r\nstruct S13707\r\n{\r\n    void* a;\r\n    void* b;\r\n    this(void* a, void* b)\r\n    {\r\n        this.a = a;\r\n        this.b = b;\r\n    }\r\n}\r\n\r\nextern(C++) S13707 func13707();\r\n```\r\nI read clang source, peeked at ItaniumCXXAB.cpp and TargetInfo.cpp.  According to `ItaniumCXXABI::classifyReturnType()`, the struct return is indirect if there is either a nonTrivialDestructor or nonTrivialCopyConstructor.  The test struct `S13707` has neither of these.  Our `TargetABI::isPOD()` almost works for OSX except for the hasCtor clause.  A little edit and OSX -m32 runnable/cppa will pass:\r\n\r\n```D\r\nbool TargetABI::isPOD(Type *t, LINK l) {\r\n  t = t->toBasetype();\r\n  assert(t->ty == Tstruct);\r\n  StructDeclaration *sd = static_cast<TypeStruct *>(t)->sym;\r\n  // the C++ definition of PODs excludes structs with constructors\r\n  //return sd->isPOD() && !(l == LINKcpp && hasCtor(sd));\r\n  return sd->isPOD();\r\n}\r\n```\r\n\r\nI would guess Linux would have the same issue, but CI shows it passing.  Hmmm.  Maybe this needs an OSX unique change."}}