[LLVMbugs] [Bug 13236] New: Microsoft compatibility: support __super specifier to access members of base classes

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 29 01:36:55 PDT 2012


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

             Bug #: 13236
           Summary: Microsoft compatibility: support __super specifier to
                    access members of base classes
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: avakar at ratatanek.cz
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Official docs:
http://msdn.microsoft.com/en-us/library/94dw1w7x%28v=vs.80%29.aspx

Unofficially, the grammar seems to be

    qualified-id:
      '__super' '::' unqualified-id

__super can't be chained (i.e. __super::__super is invalid).

__super is only valid in member function scope (in particular, the following is
invalid:

    struct A { typedef int t; };
    struct B: A {
        typedef __super::t u; // error
    }
).

The unqualified-id is looked up in all the base classes and the results are
merged.

    struct A { void foo(long); };
    struct B { void foo(int); };
    struct C: A, B { 
        void test() {
            __super::foo(1); // OK: calls B::foo
        }
    };

The result may name a type-name.

    struct A { typedef int t; };
    struct B: A {
        typedef long t;
        void test() {
            __super::t v; // OK: the type of 'v' is 'int'
        }
    };

__super is enabled only when compiling without /Za (disable language
extensions).

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list