[llvm-bugs] [Bug 37768] New: expected the class name after '~' to name a destructor

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 11 09:21:14 PDT 2018


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

            Bug ID: 37768
           Summary: expected the class name after '~' to name a destructor
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: spiri.luca96 at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

I want to inherit the ctors of the base class and have a user-defined dtor in
my template specialization Class<Enum::b>. This won't work because I used a
type alias to name the base class, then I used the real class name to name the
inherited ctor. After this the name of the dtor doesn't get recognized anymore.
--

enum class Enum{
    a, b, c
};

template<Enum, typename...>
struct Class {};

template<typename... Args>
using base_t = Class<Enum::a, Args...>;

template<typename... Args>
struct Class<Enum::b, Args...> : base_t<Args...>{
    using base_t<Args...>::Class;
    ~Class() {} // expected class name after '~' to name a destructor
};

int main() {}

-- 
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/20180611/899766f8/attachment.html>


More information about the llvm-bugs mailing list