aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@gcc.gnu.org>2019-08-28 13:36:54 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-08-28 13:36:54 +0000
commita09b09ccee0208c68d5a6bb57fda94f55db4aded (patch)
tree885f4aa75c6115de2990ceae576390db1f4f1ed9 /gcc/cp
parent629c4e52e48ae0a02cd757815c8dc25a41a53d88 (diff)
downloadgcc-a09b09ccee0208c68d5a6bb57fda94f55db4aded.zip
gcc-a09b09ccee0208c68d5a6bb57fda94f55db4aded.tar.gz
gcc-a09b09ccee0208c68d5a6bb57fda94f55db4aded.tar.bz2
[PR c++/90613] Fix using-decl debug bloat
https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01888.html cp/ PR c++/90613 * name-lookup.c (cp_emit_debug_info): Check for builtins during overload iteration. testsuite/ PR c++/90613 * g++.dg/lookup/using61.C: New. From-SVN: r274991
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/name-lookup.c33
2 files changed, 23 insertions, 16 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b735dab..08a44b6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2019-08-28 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/90613
+ * name-lookup.c (cp_emit_debug_info): Check for builtins during
+ overload iteration.
+
2019-08-27 Marek Polacek <polacek@redhat.com>
PR c++/81676 - bogus -Wunused warnings in constexpr if.
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index a8ab4db..8bbb92d 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -7455,13 +7455,6 @@ cp_emit_debug_info_for_using (tree t, tree context)
if (seen_error ())
return;
- /* Ignore this FUNCTION_DECL if it refers to a builtin declaration
- of a builtin function. */
- if (TREE_CODE (t) == FUNCTION_DECL
- && DECL_EXTERNAL (t)
- && fndecl_built_in_p (t))
- return;
-
/* Do not supply context to imported_module_or_decl, if
it is a global namespace. */
if (context == global_namespace)
@@ -7469,18 +7462,26 @@ cp_emit_debug_info_for_using (tree t, tree context)
t = MAYBE_BASELINK_FUNCTIONS (t);
- /* FIXME: Handle TEMPLATE_DECLs. */
for (lkp_iterator iter (t); iter; ++iter)
{
tree fn = *iter;
- if (TREE_CODE (fn) != TEMPLATE_DECL)
- {
- if (building_stmt_list_p ())
- add_stmt (build_stmt (input_location, USING_STMT, fn));
- else
- debug_hooks->imported_module_or_decl (fn, NULL_TREE, context,
- false, false);
- }
+
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
+ /* FIXME: Handle TEMPLATE_DECLs. */
+ continue;
+
+ /* Ignore this FUNCTION_DECL if it refers to a builtin declaration
+ of a builtin function. */
+ if (TREE_CODE (fn) == FUNCTION_DECL
+ && DECL_EXTERNAL (fn)
+ && fndecl_built_in_p (fn))
+ continue;
+
+ if (building_stmt_list_p ())
+ add_stmt (build_stmt (input_location, USING_STMT, fn));
+ else
+ debug_hooks->imported_module_or_decl (fn, NULL_TREE, context,
+ false, false);
}
}