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

           Summary: Destructors for stack variables not firing on goto
                    from scope
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


#include "stdio.h"

class L {
public:
int i;
L(int j) : i(j) { printf("L(%d)\n", i); }
~L() { if (i != 11) printf("~L(%d)\n", i); }
};

int main(int argc, char *argv[]) {
{ L b(argc) ; printf("goto\n"); if (argc) goto l; }

l:
printf("here\n");
return 5;
}

jplevyak:svn [982] % g++ x.cc ; a.out
L(1)
goto
~L(1)
here

jplevyak:svn [983] % clang++ x.cc ; a.out
L(1)
goto
here

-- 
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