Skip to content

[Clang] Poor diagnostics for use of a template class without providing parameters in some contexts #55962

@brycelelbach

Description

@brycelelbach

Godbolt

template <typename T>
struct x;

template <typename T>
constexpr int y = x::a; // Clang diagnostic doesn't mention that `x` is a template.

using z = x; // Clang diagnostic mentions that `x` is a template.

In the definition of y, Clang complains that x isn't a "class, namespace, or enumeration", but fails to mention that it is a class template and no template parameters have been provided.

In other simpler contexts, such as the definition of the using alias y, Clang does explain that x is a class template and template parameters need to be provided.

We should improve the quality of the diagnostic for the y case - it should explain that x is a class template and template parameters are missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions