* config/rs6000/rs6000.c (rs6000_delegitimize_address): Check that
[official-gcc.git] / libstdc++-v3 / libsupc++ / tinfo.cc
blobd7affedfc2759f7d9268f92386156102be36d391
1 // Methods for type_info for -*- C++ -*- Run Time Type Identification.
2 // Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
3 // 2003, 2004, 2005, 2006, 2007, 2009, 2012
4 // Free Software Foundation
5 //
6 // This file is part of GCC.
7 //
8 // GCC is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 3, or (at your option)
11 // any later version.
13 // GCC is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // Under Section 7 of GPL version 3, you are granted additional
19 // permissions described in the GCC Runtime Library Exception, version
20 // 3.1, as published by the Free Software Foundation.
22 // You should have received a copy of the GNU General Public License and
23 // a copy of the GCC Runtime Library Exception along with this program;
24 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 // <http://www.gnu.org/licenses/>.
27 #include <bits/c++config.h>
28 #include <cstddef>
29 #include "tinfo.h"
31 std::type_info::
32 ~type_info ()
33 { }
35 #if !__GXX_TYPEINFO_EQUALITY_INLINE
37 // We can't rely on common symbols being shared between shared objects.
38 bool std::type_info::
39 operator== (const std::type_info& arg) const _GLIBCXX_NOEXCEPT
41 #if __GXX_MERGED_TYPEINFO_NAMES
42 return name () == arg.name ();
43 #else
44 /* The name() method will strip any leading '*' prefix. Therefore
45 take care to look at __name rather than name() when looking for
46 the "pointer" prefix. */
47 return (&arg == this)
48 || (__name[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0));
49 #endif
52 #endif
54 namespace std {
56 // return true if this is a type_info for a pointer type
57 bool type_info::
58 __is_pointer_p () const
60 return false;
63 // return true if this is a type_info for a function type
64 bool type_info::
65 __is_function_p () const
67 return false;
70 // try and catch a thrown object.
71 bool type_info::
72 __do_catch (const type_info *thr_type, void **, unsigned) const
74 return *this == *thr_type;
77 // upcast from this type to the target. __class_type_info will override
78 bool type_info::
79 __do_upcast (const abi::__class_type_info *, void **) const
81 return false;