This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67825] New: [concepts] expression constraint bug when taking address of a member function
- From: "ryan.burn at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Oct 2015 20:22:42 +0000
- Subject: [Bug c++/67825] New: [concepts] expression constraint bug when taking address of a member function
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67825
Bug ID: 67825
Summary: [concepts] expression constraint bug when taking
address of a member function
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ryan.burn at gmail dot com
Target Milestone: ---
The below code prints 1 but &A::operator() is an invalid expression so it
should print 0.
///////////////////////////////////////////
#include <iostream>
struct A {
template <class T>
double operator()(T x) const {
return 0;
}
};
template <class X> concept bool C() {
return requires {
&X::operator();
};
}
int main() {
std::cout << C<A>() << '\n';
return 0;
}
///////////////////////////////////////////