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++/79954] New: [C++17] Explicit deduction guide not rejected when defined outside inline namespace enclosing the type


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

            Bug ID: 79954
           Summary: [C++17] Explicit deduction guide not rejected when
                    defined outside inline namespace enclosing the type
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

inline namespace x
{
  template<typename T>
    struct X
    {
      template<typename U>
        X(U&&) { };
    };
}

template<typename T> X(T) -> X<T>;

I believe this is invalid and should be rejected.

If I'm wrong, then the deduction guide should be used by:

X obj(1);

but it fails to deduce the template argument.

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