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++/74744] New: Fails to select overridden function when determined by template parameter


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=74744

            Bug ID: 74744
           Summary: Fails to select overridden function when determined by
                    template parameter
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xaxxon at gmail dot com
  Target Milestone: ---

clang compiles https://godbolt.org/g/rUizCC, gcc doesn't:
https://godbolt.org/g/d45fkS  (problem seems to be around one having a *const*
pointer)

#include <functional>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

#define TYPE char * const    <== DOESN'T WORK
//#define TYPE char const *  <== WORKS

class Foo {
public:
  void func(int){}
  void func(TYPE){}
};


template<class R, class T, class... Args>
void gimme(R(T::*funky)(Args...)) {

}

int main() {
  gimme<void, Foo, TYPE>(&Foo::func);
}


The issue seems to be around a const pointer.   Pointer to const doesn't have
any issue.  

This has been a problem since 4.7.3 (according to compilers on gcc.godbolt.org)

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