[LLVMbugs] [Bug 7717] New: problem with error reporting on throw specifiers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 26 12:25:48 PDT 2010


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

           Summary: problem with error reporting on throw specifiers
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: james at markzware.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The code listed below produces the following error on gcc. 

error: looser throw specifier for ‘virtual cChild::~cChild() throw
(std::exception&)’
error:   overriding ‘virtual cParent::~cParent() throw ()’


It seem to me that it should produce an error 


"error: exception specification of overriding function is more lax than base
version"

on clang. It does not. However, I have had this error message returned on code
that doesn't in fact have a looser exception specifier on the child than it
does on the parent. I cannot reproduce the error on code simple enough to
submit for your review. When attempting to produce an example to demonstrate
the problem, I wasn't able to cause the error to happen even when it should
happen.



class cParent
{
public:

    virtual ~cParent() throw()
    {
    }


};



class cChild : public cParent
{
public:

    virtual ~cChild() throw(std::exception&)
    {
    }

};



int main (int argc, const char * argv[]) 
{

    cChild* c = new cChild();
    return 0;
}

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