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

Test case courtesy of Eli:

class DefaultedDefaultConstructor {
    bool hasValue;
    bool value;
    DefaultedDefaultConstructor() = default;
class NoDefaultConstructor {
    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.
llvm-bugs mailing list

Reply via email to