diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-06 20:51:52 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-06 20:51:52 +0000 |
commit | 6fe110773dc4e0ff861a8e05ab53ead156686b35 (patch) | |
tree | 6b6815281c65b569db623d6f41bf2f7830a753db /libiberty | |
parent | 4681b76f40cb3a71016071aaf75bd7c74d98321f (diff) | |
download | gcc-6fe110773dc4e0ff861a8e05ab53ead156686b35.tar.gz |
Add support for C++0x nullptr.
gcc:
* c-common.c (c_common_reswords): Add nullptr.
* c-common.h: Add RID_NULLPTR. Reorganize C++0x rids.
* dwarf2out.c (is_base_type): Handle NULLPTR_TYPE.
(gen_type_die_with_usage): Likewise.
* dbxout.c (dbxout_type): Likewise.
* sdbout.c (plain_type_1): Likewise.
gcc/cp:
* cp-tree.def: Add NULLPTR_TYPE.
* cp-tree.h: Add nullptr_node.
(cp_tree_index): Add CPTI_NULLPTR.
(SCALAR_TYPE_P): Add NULLPTR_TYPE.
* call.c (null_ptr_cst_p): Handle nullptr.
(standard_conversion): Likewise.
(convert_arg_to_ellipsis): Likewise.
* mangle.c (write_type): Likewise.
* name-lookup.c (arg_assoc_type): Likewise.
* parser.c (cp_parser_primary_expression): Likewise.
* typeck.c (cp_build_binary_op): Likewise.
(build_reinterpret_cast_1): Likewise.
* error.c (dump_type): Likewise.
(dump_type_prefix, dump_type_suffix): Likewise.
* decl.c (cxx_init_decl_processing): Likewise.
* cxx-pretty-print.c (pp_cxx_constant): Likewise.
* cvt.c (ocp_convert): Likewise.
* rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
nullptr_t tinfo in libsupc++.
libstdc++-v3:
* config/abi/pre/gnu.ver: Add typeinfo for decltype(nullptr).
libiberty:
* cp-demangle.c (cplus_demangle_builtin_types): Add nullptr.
(cplus_demangle_type): Handle nullptr.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159131 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 7 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 8 | ||||
-rw-r--r-- | libiberty/cp-demangle.h | 2 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 3 |
4 files changed, 19 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index cf4cdc45aa5..4414e04792f 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,10 @@ +2010-05-06 Magnus Fromreide <magfr@lysator.liu.se> + Jason Merrill <jason@redhat.com> + + * cp-demangle.c (cplus_demangle_builtin_types): Add nullptr. + (cplus_demangle_type): Handle nullptr. + * testsuite/demangle-expected: Test it. + 2010-04-23 Pedro Alves <pedro@codesourcery.com> * lbasename.c (lbasename): Split into ... diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 98c64db552f..6db1f78be3c 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1987,6 +1987,8 @@ cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] = /* 29 */ { NL ("half"), NL ("half"), D_PRINT_FLOAT }, /* 30 */ { NL ("char16_t"), NL ("char16_t"), D_PRINT_DEFAULT }, /* 31 */ { NL ("char32_t"), NL ("char32_t"), D_PRINT_DEFAULT }, + /* 32 */ { NL ("decltype(nullptr)"), NL ("decltype(nullptr)"), + D_PRINT_DEFAULT }, }; CP_STATIC_IF_GLIBCPP_V3 @@ -2221,6 +2223,12 @@ cplus_demangle_type (struct d_info *di) ret = d_vector_type (di); break; + case 'n': + /* decltype(nullptr) */ + ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[32]); + di->expansion += ret->u.s_builtin.type->len; + break; + default: return NULL; } diff --git a/libiberty/cp-demangle.h b/libiberty/cp-demangle.h index aad37437400..eac054ed1e2 100644 --- a/libiberty/cp-demangle.h +++ b/libiberty/cp-demangle.h @@ -147,7 +147,7 @@ struct d_info extern const struct demangle_operator_info cplus_demangle_operators[]; #endif -#define D_BUILTIN_TYPE_COUNT (32) +#define D_BUILTIN_TYPE_COUNT (33) CP_STATIC_IF_GLIBCPP_V3 const struct demangle_builtin_type_info diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 672f35216fe..a3331c45ee8 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -3938,6 +3938,9 @@ decltype ((operator+)({parm#1}, {parm#1})) f<A>(A) --format=gnu-v3 _Z1hI1AEDTcldtfp_miEET_ decltype (({parm#1}.(operator-))()) h<A>(A) +--format=gnu-v3 +_Z1fDn +f(decltype(nullptr)) # # Ada (GNAT) tests. # |