[llvm-bugs] [Bug 44629] New: Alias template name rejected in explicit destructor call

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 23 04:28:52 PST 2020


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

            Bug ID: 44629
           Summary: Alias template name rejected in explicit destructor
                    call
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: paavo at osa.pri.ee
                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

Clang (all versions which I could try) reports a compile error on the explicit
destructor call line:

error: no member named 'B' in 'A<int, int>'

(gcc and msvc accept this code).

template <typename T, typename U>
class A {};

template <typename T>
using B = A<T, int>;

template <typename T>
void foo(B<T>* x) {

        // Fails with error: no member named 'B' in 'A<int, int>'
        x->~B<T>();

        // workaround:
        //using BT = B<T>;
        //x->~BT();
}

// instantiate foo()
template void foo<int>(B<int>* x);
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/20200123/d6b77824/attachment.html>


More information about the llvm-bugs mailing list