This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67825] New: [concepts] expression constraint bug when taking address of a member function


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;
}
///////////////////////////////////////////


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]