[LLVMbugs] [Bug 9938] New: Implicit copy assignment exception spec not enforced

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 17 17:53:02 PDT 2011


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

           Summary: Implicit copy assignment exception spec not enforced
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: scshunt at csclub.uwaterloo.ca
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following code should not execute successfully:


struct A{ };
struct B{ };

struct foo {
  void operator=(const foo&) throw(B) {}
};

struct bar {
  bar& operator = (const bar&) {
    throw A();
  }
};

struct baz : foo {
  bar b;
};

int main() {
  try {
    baz bb;
    bb = bb;
  } catch (...) { }
}


What should happen is that bar's copy assignment operator gets an implicit
throw spec of throw(B), then terminate() is called when the A exception object
attempts to leave it. Instead, we don't even generate an unexpected exception
trampoline for baz' copy assignment.

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



More information about the llvm-bugs mailing list