https://bugs.llvm.org/show_bug.cgi?id=38614

            Bug ID: 38614
           Summary: [OpenCL C++] Address-space breaks returning
                    struct-type from a function:
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Simplified from the C standard library:

https://godbolt.org/g/8fdWKq

struct llvmdiv_t {};

llvmdiv_t f1(){
    return llvmdiv_t{};
}

llvmdiv_t f2(){
    llvmdiv_t q;
    return q;
}

<source>:4:12: error: no matching constructor for initialization of 'llvmdiv_t'

    return llvmdiv_t{};

           ^~~~~~~~~~~

<source>:1:8: note: candidate constructor (the implicit copy constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'const llvmdiv_t &'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit move constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'llvmdiv_t &&'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit default constructor)
not viable: requires 0 arguments, but 1 was provided

<source>:9:12: error: no matching constructor for initialization of 'llvmdiv_t'

    return q;

           ^

<source>:1:8: note: candidate constructor (the implicit copy constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'const llvmdiv_t &'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit move constructor) not
viable: address space mismatch in 1st argument ('llvmdiv_t'), parameter type
must be 'llvmdiv_t &&'

struct llvmdiv_t {};

       ^

<source>:1:8: note: candidate constructor (the implicit default constructor)
not viable: requires 0 arguments, but 1 was provided

2 errors generated.

Compiler returned: 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to