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.
This brings several improvements: - avoiding erroneous consideration of aliased component types as provided just because their forward declaration is in the other (internal alias declaring) file; - avoiding erroneous consideration of aliased template arguments as provided due to a nested type alias; - correct handling of aliased types in contexts other than direct aliased type usage (e. g. when handling function return type); - recursive handling of nested alias templates similar to `typedef`s; - avoiding of losing nested `typedef` internals during recursive collecting their provided types, like `Class` inside such an elaborated alias: `using AliasedClass = Identity<Class>::Alias;`.
- Loading branch information
1 parent
d3d5a6a
commit 1f53a15
Showing
11 changed files
with
132 additions
and
18 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
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,14 @@ | ||
//===--- iwyu_stricter_than_cpp-d5.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 "iwyu_stricter_than_cpp-i4.h" | ||
|
||
// No forward-declaration of 'IndirectClass' here. | ||
|
||
IndirectStruct4::IndirectClassNonProvidingTypedef RetNonProvidingTypedef(); |
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
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,30 @@ | ||
//===--- typedef_chain_in_template-d5.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/typedef_chain_in_template-i1.h" | ||
#include "tests/cxx/typedef_chain_in_template-i2.h" | ||
|
||
template <typename T> | ||
struct IdentityStructComplex { | ||
using Type = typename TypedefWrapper<T>::value_type; | ||
}; | ||
|
||
template <typename T> | ||
using IdentityAlias = T; | ||
|
||
template <typename T> | ||
using IdentityAliasComplex = IdentityAlias<T>; | ||
|
||
template <typename T> | ||
struct Tpl { | ||
static constexpr auto s = sizeof(T); | ||
}; | ||
|
||
using TplWithNonProvidedAliased1 = Tpl<NonProvidingAlias>; | ||
using TplWithNonProvidedAliased2 = Tpl<NonProvidingAliasTpl<1>>; |
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,15 @@ | ||
//===--- typedef_chain_in_template-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. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
class TypedefChainClass; | ||
|
||
using NonProvidingAlias = TypedefChainClass; | ||
|
||
template <int> | ||
using NonProvidingAliasTpl = TypedefChainClass; |
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
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