{"action":"opened","issue":{"url":"https://api.github.com/repos/CastXML/CastXML/issues/55","repository_url":"https://api.github.com/repos/CastXML/CastXML","labels_url":"https://api.github.com/repos/CastXML/CastXML/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/CastXML/CastXML/issues/55/comments","events_url":"https://api.github.com/repos/CastXML/CastXML/issues/55/events","html_url":"https://github.com/CastXML/CastXML/issues/55","id":147071866,"number":55,"title":"Default constructor created for non-default constructible type","user":{"login":"praetorian20","id":10395685,"avatar_url":"https://avatars.githubusercontent.com/u/10395685?v=3","gravatar_id":"","url":"https://api.github.com/users/praetorian20","html_url":"https://github.com/praetorian20","followers_url":"https://api.github.com/users/praetorian20/followers","following_url":"https://api.github.com/users/praetorian20/following{/other_user}","gists_url":"https://api.github.com/users/praetorian20/gists{/gist_id}","starred_url":"https://api.github.com/users/praetorian20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praetorian20/subscriptions","organizations_url":"https://api.github.com/users/praetorian20/orgs","repos_url":"https://api.github.com/users/praetorian20/repos","events_url":"https://api.github.com/users/praetorian20/events{/privacy}","received_events_url":"https://api.github.com/users/praetorian20/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-09T00:37:24Z","updated_at":"2016-04-09T00:37:24Z","closed_at":null,"body":"Given this type\r\n```\r\nstruct const_item\r\n{\r\n  const int values[10];\r\n};\r\n```\r\nCastXML generates the following XML output\r\n```\r\n  <Struct id=\"_6\" name=\"const_item\" context=\"_1\" location=\"f1:578\" file=\"f1\" line=\"578\" members=\"_11 _12 _13 _14\" size=\"320\" align=\"32\"/>\r\n  <Constructor id=\"_12\" name=\"const_item\" context=\"_6\" access=\"public\" location=\"f1:578\" file=\"f1\" line=\"578\" inline=\"1\" artificial=\"1\"/>\r\n  <Constructor id=\"_13\" name=\"const_item\" context=\"_6\" access=\"public\" location=\"f1:578\" file=\"f1\" line=\"578\" inline=\"1\" artificial=\"1\" throw=\"\">\r\n    <Argument type=\"_20\" location=\"f1:578\" file=\"f1\" line=\"578\"/>\r\n  </Constructor>\r\n```\r\nThe first `Constructor` element seems invalid because `const_item`'s default constructor is implicitly declared as deleted. Otherwise, the implicit definition would be ill-formed because it would attempt to default initialize the `const` data member. This is specified in the last sentence under [[dcl.init]/7](http://eel.is/c++draft/dcl.init#7)\r\n\r\n> If a program calls for the default initialization of an object of a const-qualified type `T`, `T` shall be a class type with a user-provided default constructor.\r\n\r\nBoth gcc and clang fail to compile [this example](http://coliru.stacked-crooked.com/a/b60ca8d9032f4644).\r\n\r\nThe first `Constructor` element should either be absent, or it should have an extra attribute, say `deleted=\"1\"`. If the extra attribute is added, it might be a good idea to also include another attribute `defaulted=\"1\"` which would be set for C++11 code that explicitly `=default`s member functions."}}