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

            Bug ID: 22809
           Summary: struct type alias with 'using' doesn't match correct
                    constructor when defined inside the class
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

#include <iostream>

struct c
{
    using t1 = struct {int z;};
    using t2 = struct {double z;};
    using t3 = struct {float z;};
    using t4 = struct {float z;};

    c(t1) { std::cout << 1; }
    c(t2) { std::cout << 2; }
    c(t3) { std::cout << 3; }
    c(t4) { std::cout << 4; }
};

int main()
{
    c a1{c::t1()};
    c a2{c::t2()};
    c a3{c::t3()};
    c a4{c::t4()};
    return 0;
}

This code should display '1234' but prints '4444' instead. If I move the alias
definitions outside the class it works as expected.

$ clang --version    
clang version 3.5.1 (tags/RELEASE_351/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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