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.
Scan aliased class template member functions
The main change is in iwyu_ast_util.h. It allows not to short-circuit aliased template specialization types inside TraverseFunctionIfInstantiatedTpl method. The change in iwyu.cc is to avoid regression with cases like Outer<Providing>::Inner<Providing>::AliasedTpl pp; (see tests/cxx/typedef_in_template.cc). It facilitates collecting provided types from member function (ctor or dtor in that case) base type qualifiers.
- Loading branch information
1 parent
cbc19e0
commit c75230d
Showing
4 changed files
with
53 additions
and
5 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
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,43 @@ | ||
//===--- template_member_functions.cc - 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. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// IWYU_ARGS: -I . | ||
|
||
// Tests scanning class template member functions. | ||
|
||
#include "tests/cxx/direct.h" | ||
|
||
template <typename T> | ||
struct Tpl { | ||
static void StaticFn() { | ||
T t; | ||
} | ||
}; | ||
|
||
class IndirectClass; | ||
using NonProviding = Tpl<IndirectClass>; | ||
|
||
void Fn() { | ||
// IWYU: IndirectClass is...*indirect.h | ||
NonProviding::StaticFn(); | ||
} | ||
|
||
/**** IWYU_SUMMARY | ||
tests/cxx/template_member_functions.cc should add these lines: | ||
#include "tests/cxx/indirect.h" | ||
tests/cxx/template_member_functions.cc should remove these lines: | ||
- #include "tests/cxx/direct.h" // lines XX-XX | ||
- class IndirectClass; // lines XX-XX | ||
The full include-list for tests/cxx/template_member_functions.cc: | ||
#include "tests/cxx/indirect.h" // for IndirectClass | ||
***** IWYU_SUMMARY */ |