Skip to content

GCC warns -Wnon-template-friend on LLVM #67942

Open
@danakj

Description

@danakj

Clang does not have this warning but GCC is finding this mistake in LLVM 18 due to a recent change.

/usr/lib/llvm-18/include/llvm/ADT/PagedVector.h:213:59: warning: friend declaration ‘bool llvm::operator==(const PagedVector<T, PageSize>::MaterializedIterator&, const PagedVector<T, PageSize>::MaterializedIterator&)’ declares a non-template function [-Wnon-template-friend]
  213 |                            MaterializedIterator const &RHS);
      |                                                           ^
/usr/lib/llvm-18/include/llvm/ADT/PagedVector.h:213:59: note: (if this is not what you intended, make sure the function template has already been declared and add ‘<>’ after the function name here)
/usr/lib/llvm-18/include/llvm/ADT/PagedVector.h:215:59: warning: friend declaration ‘bool llvm::operator!=(const PagedVector<T, PageSize>::MaterializedIterator&, const PagedVector<T, PageSize>::MaterializedIterator&)’ declares a non-template function [-Wnon-template-friend]
  215 |                            MaterializedIterator const &RHS);
      |                                                           ^

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions