[llvm-bugs] [Bug 31715] New: Explicit destructor call type agreement inconsistently enforced with template-ids and qualified-ids

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 21 08:50:09 PST 2017


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

            Bug ID: 31715
           Summary: Explicit destructor call type agreement inconsistently
                    enforced with template-ids and qualified-ids
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david_work at me.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Clang forbids base-class destructor calls on derived objects, except when the
base is named by a template-id or a qualified-id.

template< typename >
struct b { ~ b () {} };
typedef b< int > q;

struct a : q {};

int main() {
    a x;
    x.~b< int >(); // Allowed
    x.q::~q(); // Allowed
    x.~q(); // Error
}

Also, what standard rule is being diagnosed? [class.dtor]/14 says, "The
invocation of a destructor is subject to the usual rules for member functions…"
and the example there has similar cases of base-destructor invocation, which
Clang does allow, one of which uses a qualified-id.

-- 
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/20170121/ac0bb372/attachment.html>


More information about the llvm-bugs mailing list