forked from include-what-you-use/include-what-you-use
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider associated header desired includes
The statement that IWYU doesn't change associated headers is clearly wrong. When handling a main file, it should take into account what it suggests to do with its associated headers, not what those headers look like at the moment of the analysis. It is assumed that the desired `#include`s of the associated headers have been calculated before handling the main file, as it was already assumed in the code. This fixes include-what-you-use#1142.
- Loading branch information
1 parent
7e5c30a
commit 0d8bfad
Showing
7 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//===--- associated_include-d1.h - test input file for iwyu ---------------===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "tests/cxx/associated_include-i2.h" // IWYU pragma: export | ||
|
||
class ClassFromD1 {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//===--- associated_include-d2.h - test input file for iwyu ---------------===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "tests/cxx/associated_include-i3.h" // IWYU pragma: export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//===--- associated_include-i2.h - test input file for iwyu ---------------===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef INCLUDE_WHAT_YOU_USE_TESTS_CXX_ASSOCIATED_INCLUDE_I2_H_ | ||
#define INCLUDE_WHAT_YOU_USE_TESTS_CXX_ASSOCIATED_INCLUDE_I2_H_ | ||
|
||
#include "tests/cxx/associated_include-i3.h" | ||
|
||
class ClassExportedThroughD1 {}; | ||
|
||
#endif // INCLUDE_WHAT_YOU_USE_TESTS_CXX_ASSOCIATED_INCLUDE_I2_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//===--- associated_include-i3.h - test input file for iwyu ---------------===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef INCLUDE_WHAT_YOU_USE_TESTS_CXX_ASSOCIATED_INCLUDE_I3_H_ | ||
#define INCLUDE_WHAT_YOU_USE_TESTS_CXX_ASSOCIATED_INCLUDE_I3_H_ | ||
|
||
class ClassFromI3 {}; | ||
|
||
#endif // INCLUDE_WHAT_YOU_USE_TESTS_CXX_ASSOCIATED_INCLUDE_I3_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters