{"action":"created","issue":{"url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/228","labels_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/228/comments","events_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/228/events","html_url":"https://github.com/include-what-you-use/include-what-you-use/issues/228","id":112376226,"number":228,"title":"IWYU suggest duplicated includes, if <...> and \"...\" would both work","user":{"login":"SebastianNiemann","id":5516578,"avatar_url":"https://avatars.githubusercontent.com/u/5516578?v=3","gravatar_id":"","url":"https://api.github.com/users/SebastianNiemann","html_url":"https://github.com/SebastianNiemann","followers_url":"https://api.github.com/users/SebastianNiemann/followers","following_url":"https://api.github.com/users/SebastianNiemann/following{/other_user}","gists_url":"https://api.github.com/users/SebastianNiemann/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianNiemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianNiemann/subscriptions","organizations_url":"https://api.github.com/users/SebastianNiemann/orgs","repos_url":"https://api.github.com/users/SebastianNiemann/repos","events_url":"https://api.github.com/users/SebastianNiemann/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianNiemann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-20T14:04:54Z","updated_at":"2015-11-07T15:48:46Z","closed_at":null,"body":"Given a source file **b.cpp** and its header file **b.hpp**, both depending on another source file **a.hpp**. If this file is included by the header file **b.hpp** using <...>, while \"...\" would also work, IWYU suggest to add **a.hpp** into the source **b.cpp** using \"...\", which is a duplicated include between the header and source file.\r\n\r\nShort working example, demonstrating the problem:\r\n**a.hpp**\r\n```cpp\r\nclass A {\r\n  public:\r\n    void doSomething();\r\n};\r\n```\r\n\r\n**b.hpp**\r\n```cpp\r\n#include <a.hpp>\r\n\r\nclass B : public A {\r\n  public:\r\n    void doSomethingMore();\r\n};\r\n```\r\n\r\n**b.cpp**\r\n```cpp\r\n#include <b.hpp>\r\n\r\nvoid B::doSomethingMore() {\r\n  A::doSomething();\r\n}\r\n```\r\n\r\nOutput of `iwyu -I. b.cpp`:\r\n```text\r\n(b.hpp has correct #includes/fwd-decls)\r\n\r\nb.cpp should add these lines:\r\n#include \"a.hpp\"                        // for A\r\n\r\nb.cpp should remove these lines:\r\n\r\nThe full include-list for b.cpp:\r\n#include <b.hpp>\r\n#include \"a.hpp\"                        // for A\r\n---\r\n```"},"comment":{"url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/comments/154717296","html_url":"https://github.com/include-what-you-use/include-what-you-use/issues/228#issuecomment-154717296","issue_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/228","id":154717296,"user":{"login":"cdglove","id":1856042,"avatar_url":"https://avatars.githubusercontent.com/u/1856042?v=3","gravatar_id":"","url":"https://api.github.com/users/cdglove","html_url":"https://github.com/cdglove","followers_url":"https://api.github.com/users/cdglove/followers","following_url":"https://api.github.com/users/cdglove/following{/other_user}","gists_url":"https://api.github.com/users/cdglove/gists{/gist_id}","starred_url":"https://api.github.com/users/cdglove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdglove/subscriptions","organizations_url":"https://api.github.com/users/cdglove/orgs","repos_url":"https://api.github.com/users/cdglove/repos","events_url":"https://api.github.com/users/cdglove/events{/privacy}","received_events_url":"https://api.github.com/users/cdglove/received_events","type":"User","site_admin":false},"created_at":"2015-11-07T15:48:46Z","updated_at":"2015-11-07T15:48:46Z","body":"Is it possible for IWYU to simply use the style that included the file in the first place? Or is that information lost? "}}