[LLVMbugs] [Bug 19904] New: rejects-valid with two-phase destructor name lookup

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 30 17:16:07 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19904

            Bug ID: 19904
           Summary: rejects-valid with two-phase destructor name lookup
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang rejects this code, which I think is valid:

  struct A {};
  template<typename T> struct S { void f(A *p) { p->~T(); } };

Saying...

<stdin>:2:52: error: destructor type 'T' in object destruction expression does
not match the type 'A' of the object being destroyed
template<typename T> struct S { void f(A *p) { p->~T(); } }; void g() {
S<A>().f(0); }
                                                   ^

EDG at least thinks this code is valid, and I agree. (T is looked up within A
and within the current scope, so in this case it should name the template
parameter, which could certainly be 'A'.)

-- 
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/20140531/9deb2d75/attachment.html>


More information about the llvm-bugs mailing list