Skip to content

Candidate function is _explicitly_ deleted, not implicitly #185693

@kparzysz

Description

@kparzysz

The diagnostic message says that the candidate function was implicitly deleted while the deletion was most definitely explicit:

Testcase:

#include <iostream>

template <typename T>
void fred(const T &x) {
  std::cout << x << "\n";
}

template <>
void fred(const double &) = delete;

int main() {
  fred(8.0);
}

clang++ tdel1.cc

tdel1.cc:13:3: error: call to deleted function 'fred'
   13 |   fred(8.0);
      |   ^~~~
tdel1.cc:9:6: note: candidate function [with T = double] has been implicitly
      deleted
    9 | void fred(const double &) = delete;
      |      ^
1 error generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++11clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions