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

             Bug #: 13676
           Summary: [Windows] Segmentation fault when filling an int-int
                    struct to be returned
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


As of r160851,

$ cat with_cl.cpp
struct S {
  int a, b;
};

class C {
 public:
  S foo();
};

S C::foo() {
  S ret;
  ret.a = 1;
  ret.b = 2;
  return ret;
}
///////////////////// EOF
$ cat with_clang.cpp
struct S {
  int a, b;
};

class C {
 public:
  S foo();
};

int main() {
  C c;
  S s = c.foo();
  if (s.a != 1)
    return 1;
  if (s.b != 2)
    return 2;
}
///////////////////// EOF
$ clang -Xclang -cxx-abi -Xclang microsoft -c with_clang.cpp && cl -nologo -c
with_cl.cpp && link -nologo with_cl.obj with_clang.o

$ with_cl.exe
Segmentation fault

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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