Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ void RedundantTypenameCheck::check(const MatchFinder::MatchResult &Result) {
const SourceLocation ElaboratedKeywordLoc = [&] {
if (const auto *NonDependentTypeLoc =
Result.Nodes.getNodeAs<TypeLoc>("nonDependentTypeLoc")) {
if (const auto TL = NonDependentTypeLoc->getAs<TypedefTypeLoc>())
return TL.getElaboratedKeywordLoc();
if (const auto TL = NonDependentTypeLoc->getAs<TypedefTypeLoc>()) {
if (!TL.getType()->isDependentType())
return TL.getElaboratedKeywordLoc();
}

if (const auto TL = NonDependentTypeLoc->getAs<TagTypeLoc>())
return TL.getElaboratedKeywordLoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,17 @@ WHOLE_TYPE_IN_MACRO Macro2;

#define WHOLE_DECLARATION_IN_MACRO typename NotDependent::R Macro3
WHOLE_DECLARATION_IN_MACRO;

template<typename T> struct ListWrapper {};
template<typename T>
class ClassWrapper {
public:
using Argument = ListWrapper<T>;
ListWrapper<Argument> arguments;
ListWrapper<Argument> getArguments() const;
};
template<typename T>
ListWrapper<typename ClassWrapper<T>::Argument> ClassWrapper<T>::getArguments() const {
return arguments;
}
// CHECK-NOT: warning: redundant 'typename' [readability-redundant-typename]