[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug libstdc++/14493] No std::bad_alloc::what() const



------- Additional Comments From bangerth at dealii dot org  2004-03-08 23:15 -------
For Andrew: the code takes the respective method of the base 
class. 
 
Here's a testcase: 
--------------- 
#include <iostream> 
#include <new> 
 
int main () 
{ 
  try 
    { 
      new char[static_cast<unsigned int>(-1)/2]; 
    } 
  catch (std::exception &e) 
    { 
      std::cerr << e.what () << std::endl; 
    } 
} 
---------------------- 
 
g/x> icc x.cc 
g/x> ./a.out  
bad allocation 
g/x>  
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ x.cc 
g/x> ./a.out  
St9bad_alloc 
 
I believe that libstdc++ is actually conforming, since the method exists 
(even if in the base class) and it returns an implementation defined 
string (as required by the standard). Some of the libstdc++ folks should 
comment on this. 
 
W. 

-- 


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

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.



Reply to: