[llvm-bugs] [Bug 41785] New: Making class template breaks compilation

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 7 02:35:32 PDT 2019


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

            Bug ID: 41785
           Summary: Making class template breaks compilation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: weiss at wsoptics.de
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The following code compiles iff `-DFIX` is provided:



template <int a>
struct b : b<a - 1>
{
        static constexpr unsigned c = a;
};
template <>
struct b<0>
{
};
#ifndef FIX
template <typename>
#endif
class X
{
        void e();
        static auto e(b<1> f) -> b<decltype(f)::c>;
        static auto e(b<decltype(e(b<2>{}))::c + 1> f) -> b<decltype(f)::c>;
        void e(b<decltype(e(b<2>{}))::c + 1>);
};



Also see https://godbolt.org/z/VHG_cE

-- 
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/20190507/d3690a18/attachment.html>


More information about the llvm-bugs mailing list