[llvm-bugs] [Bug 47412] New: Bogus "deduced type is not a specialization of template 'S'" on qualified name or alias in deduction guide

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 3 13:44:51 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47412

            Bug ID: 47412
           Summary: Bogus "deduced type is not a specialization of
                    template 'S'" on qualified name or alias in deduction
                    guide
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

// https://godbolt.org/z/enb44j
namespace N {
 template<class> struct S {};
 auto foo() -> N::S<int>;  // OK
 S() -> N::S<int>;  // Bogus error
} // namespace

template<class> struct S {};
auto foo() -> ::S<int>;  // OK
S() -> ::S<int>;  // Bogus error

using SA = S<int>;
S() -> SA;  // Bogus error


This code is obviously "silly", but GCC and MSVC both agree that it is valid
C++17. Clang complains:


test.cpp:5:8: error: deduced type 'N::S<int>' of deduction guide is not a
specialization of template 'S'
S() -> N::S<int>;  // Bogus error
       ^~~~~~~~~
test.cpp:10:8: error: deduced type '::S<int>' of deduction guide is not a
specialization of template 'S'
S() -> ::S<int>;  // Bogus error
       ^~~~~~~~
test.cpp:13:8: error: deduced type 'N::SA' (aka 'S<int>') of deduction guide is
not a specialization of template 'S'
S() -> SA;  // Bogus error
       ^~

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200903/8f8a1ce2/attachment.html>


More information about the llvm-bugs mailing list