aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-10-05 15:25:03 +0000
committerMark Wielaard <mark@gcc.gnu.org>2014-10-05 15:25:03 +0000
commitf50592234cdef68ddc9b98b65a88a443e2c4523f (patch)
tree700ed4a22c54f19e861b8af7cede31a1ed585658 /gcc/cp
parent0127c169d155ecdad955d1b27cbc9e34ea981d42 (diff)
downloadgcc-f50592234cdef68ddc9b98b65a88a443e2c4523f.zip
gcc-f50592234cdef68ddc9b98b65a88a443e2c4523f.tar.gz
gcc-f50592234cdef68ddc9b98b65a88a443e2c4523f.tar.bz2
PR debug/63239 Add DWARF representation for C++11 deleted member function.
include/ChangeLog * dwarf2.def (DW_AT_GNU_deleted): New attribute. gcc/ChangeLog * dwarf2out.c (gen_subprogram_die): When a member function is explicitly deleted then add a DW_AT_GNU_deleted attribute. * langhooks.h (struct lang_hooks_for_decls): Add function_decl_deleted_p langhook. * langhooks-def.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define. (LANG_HOOKS_DECLS): Add LANG_HOOKS_FUNCTION_DECL_DELETED_P. gcc/cp/ChangeLog * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define. (cp_function_decl_deleted_p): New prototype. * cp-objcp-common.c (cp_function_deleted_p): New function. gcc/testsuite/ChangeLog * g++.dg/debug/dwarf2/deleted-member-function.C: New testcase. From-SVN: r215901
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-objcp-common.c10
-rw-r--r--gcc/cp/cp-objcp-common.h3
3 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c0b6fb5..5cb8203 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-02 Mark Wielaard <mjw@redhat.com>
+
+ PR debug/63239
+ * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define.
+ (cp_function_decl_deleted_p): New prototype.
+ * cp-objcp-common.c (cp_function_deleted_p): New function.
+
2014-10-03 Marc Glisse <marc.glisse@inria.fr>
PR c++/54427
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index 0c50f40..0d144ef 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -168,6 +168,16 @@ cp_function_decl_explicit_p (tree decl)
&& DECL_NONCONVERTING_P (decl));
}
+/* Return true if DECL is deleted special member function. */
+
+bool
+cp_function_decl_deleted_p (tree decl)
+{
+ return (decl
+ && DECL_LANG_SPECIFIC (STRIP_TEMPLATE (decl))
+ && DECL_DELETED_FN (decl));
+}
+
/* Stubs to keep c-opts.c happy. */
void
push_file_scope (void)
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 246800e..c289774 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -27,6 +27,7 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
tree, bool);
extern bool cp_function_decl_explicit_p (tree decl);
+extern bool cp_function_decl_deleted_p (tree decl);
extern void cp_common_init_ts (void);
/* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks
@@ -131,6 +132,8 @@ extern void cp_common_init_ts (void);
#define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
#undef LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P
#define LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P cp_function_decl_explicit_p
+#undef LANG_HOOKS_FUNCTION_DECL_DELETED_P
+#define LANG_HOOKS_FUNCTION_DECL_DELETED_P cp_function_decl_deleted_p
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING cxx_omp_predetermined_sharing
#undef LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR