[llvm-bugs] [Bug 38614] New: [OpenCL C++] Address-space breaks returning struct-type from a function:

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 17 08:41:01 PDT 2018


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: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180817/1de9f962/attachment.html>


More information about the llvm-bugs mailing list