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

            Bug ID: 40983
           Summary: non-type template-parameter of reference type confuses
                    template specialization matching
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++'17
          Assignee: unassignedclangb...@nondot.org
          Reporter: tadeus.prast...@unitn.it
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Consider the following MWE:
-- 8< ---------------------
template<typename T, T v>
struct X {
};

template<bool &v>
struct X<bool &, v> {
};
-- 8< ---------------------

As shown in https://www.godbolt.org/z/HqqLWu, the MWE is accepted by GCC when
using C++14 (the compilation switches `-std=c++14 -pedantic-errors') and when
using C++17 (the compilation switches `-std=c++17 -pedantic-errors').

Clang also accepts the MWE when using C++14 but _not_ when using C++17.

A thread in the C++ std-discussion has just been started on this matter (see
https://groups.google.com/a/isocpp.org/d/msg/std-discussion/etn0e3qhz28/Nmpmz7NwBAAJ),
but no one has replied yet.  Nevertheless, I think this is a bug considering
that Clang accepts the MWE in C++14, and I think, there is no change in C++17
that justifies Clang behavior in rejecting the MWE in C++17.

This bug may also be related to this bug:
https://bugs.llvm.org/show_bug.cgi?id=39373

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to