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++/61174] New: [4.9 Regression] Bad resolving of specialized template with const-qualified member function


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

            Bug ID: 61174
           Summary: [4.9 Regression] Bad resolving of specialized template
                    with const-qualified member function
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ncornu@aldebaran-robotics.com

Created attachment 32788
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32788&action=edit
A file reproducing the bug

With 4.8 it compiles.

With 4.9.0 we got:
main.cpp: In instantiation of âstruct A<int (C::*)() const>â:
main.cpp:22:8:   required from âvoid make(T) [with T = int (C::*)() const]â
main.cpp:27:13:   required from here
main.cpp:6:18: attention : invalid application of âsizeofâ to a function type
[-Wpointer-arith]
   int fail[sizeof(T) - 1000];
                  ^
main.cpp: In function âvoid make(T) [with T = int (C::*)() const]â:
main.cpp:22:8: erreur: size of variable âaâ is too large
   A<T> a;
        ^

Because it use the attribute specialization of our template.

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