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

            Bug ID: 91759
           Summary: g++ accepts ill-formed deduction guides in wrong scope
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redbeard0531 at gmail dot com
  Target Milestone: ---

namespace N {
    template <typename T>
    struct X{ X(int); };
}

using N::X;

X(int) -> X<int>;

This is supposed to not compile due to
http://eel.is/c++draft/temp.deduct.guide#3.sentence-4: A deduction-guide shall
be declared in the same scope as the corresponding class template and, for a
member class template, with the same access. 

clang, icc, and msvc all correctly consider this to be ill-formed:
https://godbolt.org/z/UH3Y8W.

Reply via email to