Got a "looser throw specification" error on the implicitly generated destructor
when instantiating a template with std::string. The instantiated class derives
from the std::string parameter. Neither the instantiated class nor its other
base throws anything, nor do either have a throw specification, nor an explicit 
destructor. Std::string does have an explicit destructor, but that has no throw 
specification:
      ~basic_string()
      { _M_rep()->_M_dispose(this->get_allocator()); }


I tried to reproduce this with:
   struct s : std::string{};
and
   template<typename T> struct s1 : public T {}; s1<std::string> sx;
but both compile fine.

Note that one of the line numbers (261) in the diagnostic points to an
unrelated
line. This may suggest the source of the problem.


-- 
           Summary: bad throw specification error on implicit destructor
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24280

Reply via email to