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

            Bug ID: 85901
           Summary: Error message contains "#'offset_type' not supported
                    by simple_type_specifier#)#'offset_type' not supported
                    by direct_abstract_declarator#"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

https://wandbox.org/permlink/IQV1PEfIFY8M5T5C
----
template<class> struct A;

template<class U>
struct A<int U::*> {
    template<class TT>
    static auto c(int U::*p, TT o) -> decltype(o.*p);
};

struct X {};

int x = A<int X::*>::c();

----
prog.cc:11:24: error: no matching function for call to 'A<int X::*>::c()'
 int x = A<int X::*>::c();
                        ^
prog.cc:6:17: note: candidate: 'template<class TT> static decltype
(A<#'offset_type' not supported by simple_type_specifier#)#'offset_type' not
supported by direct_abstract_declarator#>::c::o.*A<#'offset_type' not supported
by simple_type_specifier#)#'offset_type' not supported by
direct_abstract_declarator#>::c::p) A<int U::*>::c(int U::*, TT) [with TT = TT;
U = X]'
     static auto c(int U::*p, TT o) -> decltype(o.*p);
                 ^
prog.cc:6:17: note:   template argument deduction/substitution failed:
prog.cc:11:24: note:   candidate expects 2 arguments, 0 provided
 int x = A<int X::*>::c();
                        ^
----
"#'offset_type' not supported by simple_type_specifier#)#'offset_type' not
supported by direct_abstract_declarator#" shouldn't be present in the error
message.

Maybe the nested-name-specifier before o and p are all redundant. That is, it
should be just "decltype(o.*p)", not
"decltype(A<gibberish>::c::o.*A<gibberish>::c::p)".

Reply via email to