Skip to content

C++ specialization: warning: explicit link request could not be resolved. #10964

@q-p

Description

@q-p

Describe the bug
In the following C++ code, the method linked to in the specialization cannot be found.

#include <type_traits>

/// Generic template
template<class T, class Enabled = void>
class Foo { };

/// Specialization.
/**
 * Link to #Bar(). This one is not found.
 */
template<class T>
class Foo<
  T, 
  std::enable_if_t<std::is_base_of<T, typename T::Type>::value>>
{
public:
  /// Computes stuff, another #Bar() link, also not found and reported twice.
  void Bar() const { }
};

To Reproduce
Reproducer
warning_explicit_link.zip

Expected behavior
I think the link to Bar() should be found and resolved.

Version
The following reproduces the warning on both 1.11 and current master (6221f43). Both installed using homebrew on Mac.

Additional context
It seems to work if in the enable_if_t I replace std::is_base_of<T, typename T::Type>::value by std::is_base_of_v<T, typename T::Type>, but unfortunately in the "real" code, no _v version of the problematic trait exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions