{"action":"created","issue":{"url":"https://api.github.com/repos/google/flatbuffers/issues/4122","repository_url":"https://api.github.com/repos/google/flatbuffers","labels_url":"https://api.github.com/repos/google/flatbuffers/issues/4122/labels{/name}","comments_url":"https://api.github.com/repos/google/flatbuffers/issues/4122/comments","events_url":"https://api.github.com/repos/google/flatbuffers/issues/4122/events","html_url":"https://github.com/google/flatbuffers/issues/4122","id":196611146,"node_id":"MDU6SXNzdWUxOTY2MTExNDY=","number":4122,"title":"can not create empty struct","user":{"login":"changnet","id":9293777,"node_id":"MDQ6VXNlcjkyOTM3Nzc=","avatar_url":"https://avatars1.githubusercontent.com/u/9293777?v=4","gravatar_id":"","url":"https://api.github.com/users/changnet","html_url":"https://github.com/changnet","followers_url":"https://api.github.com/users/changnet/followers","following_url":"https://api.github.com/users/changnet/following{/other_user}","gists_url":"https://api.github.com/users/changnet/gists{/gist_id}","starred_url":"https://api.github.com/users/changnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/changnet/subscriptions","organizations_url":"https://api.github.com/users/changnet/orgs","repos_url":"https://api.github.com/users/changnet/repos","events_url":"https://api.github.com/users/changnet/events{/privacy}","received_events_url":"https://api.github.com/users/changnet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-12-20T08:16:28Z","updated_at":"2018-10-15T22:45:31Z","closed_at":"2017-08-14T21:34:27Z","author_association":"CONTRIBUTOR","body":"a simple schema file:\r\n```flatbuffers\r\nstruct Empty {}\r\n```\r\ngenerate cpp header,like:\r\n```cpp\r\n// automatically generated by the FlatBuffers compiler, do not modify\r\n\r\n#ifndef FLATBUFFERS_GENERATED_TEST_H_\r\n#define FLATBUFFERS_GENERATED_TEST_H_\r\n\r\n#include \"flatbuffers/flatbuffers.h\"\r\n\r\nstruct Empty;\r\n\r\nMANUALLY_ALIGNED_STRUCT(1) Empty FLATBUFFERS_FINAL_CLASS {\r\n private:\r\n\r\n public:\r\n  Empty() { memset(this, 0, sizeof(Empty)); }\r\n  Empty(const Empty &_o) { memcpy(this, &_o, sizeof(Empty)); }\r\n  Empty()\r\n    :  { }\r\n\r\n};\r\nSTRUCT_END(Empty, 0);\r\n\r\n#endif  // FLATBUFFERS_GENERATED_TEST_H_\r\n```\r\n\r\nERROR message:\r\n```shell\r\n# g++ -std=c++11 -o main main.cpp -lflatbuffers\r\nIn file included from main.cpp:3:0:\r\ntest_generated.h:16:3: error: ‘Empty::Empty()’ cannot be overloaded\r\ntest_generated.h:14:3: error: with ‘Empty::Empty()’\r\ntest_generated.h: In constructor ‘Empty::Empty()’:\r\ntest_generated.h:17:8: error: expected identifier before ‘{’ token\r\ntest_generated.h: At global scope:\r\ntest_generated.h:20:1: error: static assertion failed: compiler breaks packing rules\r\n```\r\nIs this a bug ? if not,at least print some message while generate the file.\r\n\r\nA empty table work fine,but it takes 12bytes.\r\n"},"comment":{"url":"https://api.github.com/repos/google/flatbuffers/issues/comments/430039846","html_url":"https://github.com/google/flatbuffers/issues/4122#issuecomment-430039846","issue_url":"https://api.github.com/repos/google/flatbuffers/issues/4122","id":430039846,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDAzOTg0Ng==","user":{"login":"aardappel","id":4663648,"node_id":"MDQ6VXNlcjQ2NjM2NDg=","avatar_url":"https://avatars2.githubusercontent.com/u/4663648?v=4","gravatar_id":"","url":"https://api.github.com/users/aardappel","html_url":"https://github.com/aardappel","followers_url":"https://api.github.com/users/aardappel/followers","following_url":"https://api.github.com/users/aardappel/following{/other_user}","gists_url":"https://api.github.com/users/aardappel/gists{/gist_id}","starred_url":"https://api.github.com/users/aardappel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aardappel/subscriptions","organizations_url":"https://api.github.com/users/aardappel/orgs","repos_url":"https://api.github.com/users/aardappel/repos","events_url":"https://api.github.com/users/aardappel/events{/privacy}","received_events_url":"https://api.github.com/users/aardappel/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T22:45:31Z","updated_at":"2018-10-15T22:45:31Z","author_association":"COLLABORATOR","body":"@nicholasbishop when you come across such an empty struct, can you omit it?\r\n\r\nOk, I'll add an error for now."}}
{"actor":{"display_login":"aardappel"}}