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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to