[LLVMbugs] [Bug 10127] New: Clang does not implement N3031: decltype(type)::subtype does not compile

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 12 11:56:37 PDT 2011


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

           Summary: Clang does not implement N3031:
                    decltype(type)::subtype does not compile
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following program does not compile with clang r132676:

struct Vec3 {
    typedef float value_type;
};


int main(int, char**)
{
    Vec3    v;

    decltype(v)::value_type    x;    // Should work according to N3031
}

This results in:

$ clang -std=c++0x -stdlib=libc++ clang.cpp
clang.cpp:10:15: error: definition or redeclaration of 'value_type' cannot name
the global scope
        decltype(v)::value_type x;      // Should work according to N3031
                   ~~^
clang.cpp:10:15: error: no member named 'value_type' in the global namespace
        decltype(v)::value_type x;      // Should work according to N3031
                   ~~^
clang.cpp:10:25: error: expected ';' at end of declaration
        decltype(v)::value_type x;      // Should work according to N3031
                               ^
                               ;
3 errors generated.



This is because clang does not implement N3031 yet, the resolution for core
issue 743 which has been included in FDIS.

Core Issue 743:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3237.html#743

N3031: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3031.pdf

Related StackOverflow question:
http://stackoverflow.com/questions/6101728/behavior-of-decltype

-- 
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