Skip to content

Clang diagnostics issue: Candidate ignored without reason provided #55413

@jeremy-rifkin

Description

@jeremy-rifkin

Pardon the large demo, this came up when resting something with a library I've been writing.

In this example, https://godbolt.org/z/1o4nr958b, clang errors

<source>:1232:5: error: no matching function for call to 'foo'
    foo<bar(2)>();
    ^~~~~~~~~~~
<source>:1224:22: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'X'
template<int X> void foo() {}
                     ^

Without providing a reason why the explicitly-specified argument is invalid. GCC reports that the macro is expanding to have a problematic local static variable.

Similarly after removing the static qualifiers there are other problems with calling non-constexpr functions but clang still does not provide a diagnostic as to why the explicitly-specified argument is invalid https://godbolt.org/z/7xGrecxfe.

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