{"action":"created","issue":{"url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/240","labels_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/240/comments","events_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/240/events","html_url":"https://github.com/include-what-you-use/include-what-you-use/issues/240","id":119315362,"number":240,"title":"fix_includes.py leaves empty namespace declaraion","user":{"login":"ggeorgiev","id":1084892,"avatar_url":"https://avatars.githubusercontent.com/u/1084892?v=3","gravatar_id":"","url":"https://api.github.com/users/ggeorgiev","html_url":"https://github.com/ggeorgiev","followers_url":"https://api.github.com/users/ggeorgiev/followers","following_url":"https://api.github.com/users/ggeorgiev/following{/other_user}","gists_url":"https://api.github.com/users/ggeorgiev/gists{/gist_id}","starred_url":"https://api.github.com/users/ggeorgiev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggeorgiev/subscriptions","organizations_url":"https://api.github.com/users/ggeorgiev/orgs","repos_url":"https://api.github.com/users/ggeorgiev/repos","events_url":"https://api.github.com/users/ggeorgiev/events{/privacy}","received_events_url":"https://api.github.com/users/ggeorgiev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-28T19:59:31Z","updated_at":"2015-11-30T02:03:53Z","closed_at":null,"body":"If one or more forward declaration needs to be removed that eliminates all of them for particular namespace you would expect the namespace declaration to be removed completely.\r\n\r\nFor example if we have:\r\n\r\n    // some code\r\n\r\n    namespace foo {\r\n    class Bar;\r\n    }  // namespace foo\r\n\r\n    // some other code\r\n\r\nNow foo::Bar is no longer needed  the expected result is \r\n\r\n    // some code\r\n\r\n    // some other code\r\n\r\nInstead the result is:\r\n\r\n    // some code\r\n    namespace foo {\r\n    }  // namespace foo\r\n    // some other code\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/comments/160497445","html_url":"https://github.com/include-what-you-use/include-what-you-use/issues/240#issuecomment-160497445","issue_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/240","id":160497445,"user":{"login":"vsapsai","id":421892,"avatar_url":"https://avatars.githubusercontent.com/u/421892?v=3","gravatar_id":"","url":"https://api.github.com/users/vsapsai","html_url":"https://github.com/vsapsai","followers_url":"https://api.github.com/users/vsapsai/followers","following_url":"https://api.github.com/users/vsapsai/following{/other_user}","gists_url":"https://api.github.com/users/vsapsai/gists{/gist_id}","starred_url":"https://api.github.com/users/vsapsai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsapsai/subscriptions","organizations_url":"https://api.github.com/users/vsapsai/orgs","repos_url":"https://api.github.com/users/vsapsai/repos","events_url":"https://api.github.com/users/vsapsai/events{/privacy}","received_events_url":"https://api.github.com/users/vsapsai/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T02:03:53Z","updated_at":"2015-11-30T02:03:53Z","body":"Nice catch. When we choose if handling empty namespace should be in `fix_includes.py` or in IWYU itself, I think IWYU is more appropriate place. Because this way it will work for other ways emitting changes. And it can be tricky to teach `fix_includes.py` to detect empty namespaces."}}