[LLVMbugs] [Bug 19620] New: clang doesn't treat a typedef-name as a class-name when naming the destructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 30 22:28:10 PDT 2014


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

            Bug ID: 19620
           Summary: clang doesn't treat a typedef-name as a class-name
                    when naming the destructor
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
typedef struct T {} I;                                                         
                                                               typedef const I
CI;

void blah(I *a) {
  a->CI::~I();
}

clang gives:
<stdin>:5:11: error: expected the class name after '~' to name a destructor
  a->CI::~I();
          ^

9.1 [class.name]/5 states that a typedef-name may behave like a class-name once
it's qualifiers are ignored.
5.1.1 [expr.prim.general]/8 has the requirement that, when naming the
destructor, the two class-names must refer to the same class-name.

When keeping the above two rules in mind, there doesn't seem to be a rationale
for rejecting this code.

GCC, EDG and MSVC all accept.

-- 
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/20140501/f7e01247/attachment.html>


More information about the llvm-bugs mailing list