xref: /netbsd-src/external/gpl3/gcc.old/dist/libstdc++-v3/libsupc++/bad_array_length.cc (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1*8feb0f0bSmrg // Copyright (C) 2013-2020 Free Software Foundation, Inc.
21debfc3dSmrg //
31debfc3dSmrg // This file is part of GCC.
41debfc3dSmrg //
51debfc3dSmrg // GCC is free software; you can redistribute it and/or modify
61debfc3dSmrg // it under the terms of the GNU General Public License as published by
71debfc3dSmrg // the Free Software Foundation; either version 3, or (at your option)
81debfc3dSmrg // any later version.
91debfc3dSmrg 
101debfc3dSmrg // GCC is distributed in the hope that it will be useful,
111debfc3dSmrg // but WITHOUT ANY WARRANTY; without even the implied warranty of
121debfc3dSmrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131debfc3dSmrg // GNU General Public License for more details.
141debfc3dSmrg 
151debfc3dSmrg // Under Section 7 of GPL version 3, you are granted additional
161debfc3dSmrg // permissions described in the GCC Runtime Library Exception, version
171debfc3dSmrg // 3.1, as published by the Free Software Foundation.
181debfc3dSmrg 
191debfc3dSmrg // You should have received a copy of the GNU General Public License and
201debfc3dSmrg // a copy of the GCC Runtime Library Exception along with this program;
211debfc3dSmrg // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
221debfc3dSmrg // <http://www.gnu.org/licenses/>.
231debfc3dSmrg 
241debfc3dSmrg #include <new>
251debfc3dSmrg 
261debfc3dSmrg namespace std
271debfc3dSmrg {
281debfc3dSmrg // From N3639.  This was voted in and then back out of C++14, and is now
291debfc3dSmrg // just here for backward link compatibility with code built with 4.9.
301debfc3dSmrg class bad_array_length : public bad_alloc
311debfc3dSmrg {
321debfc3dSmrg public:
bad_array_length()331debfc3dSmrg   bad_array_length() throw() { };
341debfc3dSmrg 
351debfc3dSmrg   // This declaration is not useless:
361debfc3dSmrg   // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
371debfc3dSmrg   virtual ~bad_array_length() throw();
381debfc3dSmrg 
391debfc3dSmrg   // See comment in eh_exception.cc.
401debfc3dSmrg   virtual const char* what() const throw();
411debfc3dSmrg };
421debfc3dSmrg 
~bad_array_length()431debfc3dSmrg bad_array_length::~bad_array_length() _GLIBCXX_USE_NOEXCEPT { }
441debfc3dSmrg 
451debfc3dSmrg const char*
what() const461debfc3dSmrg bad_array_length::what() const _GLIBCXX_USE_NOEXCEPT
471debfc3dSmrg { return "std::bad_array_length"; }
481debfc3dSmrg 
491debfc3dSmrg } // namespace std
501debfc3dSmrg 
511debfc3dSmrg namespace __cxxabiv1 {
521debfc3dSmrg 
531debfc3dSmrg extern "C" void
__cxa_throw_bad_array_length()541debfc3dSmrg __cxa_throw_bad_array_length ()
551debfc3dSmrg { _GLIBCXX_THROW_OR_ABORT(std::bad_array_length()); }
561debfc3dSmrg 
571debfc3dSmrg } // namespace __cxxabiv1
58