[llvm-bugs] [Bug 41186] New: [ms] Clang returns trivial, but "non-POD" types indirectly, unlike MSVC

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 21 10:48:36 PDT 2019


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

            Bug ID: 41186
           Summary: [ms] Clang returns trivial, but "non-POD" types
                    indirectly, unlike MSVC
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Test case courtesy of Eli:

class DefaultedDefaultConstructor {
public:
    bool hasValue;
    bool value;
    DefaultedDefaultConstructor() = default;
};
class NoDefaultConstructor {
public:
    bool hasValue;
    bool value;
};
DefaultedDefaultConstructor f(int x, int y);
bool g() { return f(5, 6).value; }
NoDefaultConstructor f2(int x, int y);
bool g2() { return f2(5, 6).value; }

MSVC generates the same code for g and g2, but clang returns
DefaultedDefaultConstructor indirectly.

I tested x86 and x64, and both are wrong, but we probably get it wrong for
arm64 and thumb as well.

-- 
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/20190321/7c3a9c24/attachment-0001.html>


More information about the llvm-bugs mailing list