This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 02/11] cp_tree::maybe_add_location_wrapper: no-op for template decls
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, Jakub Jelinek <jakub at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>
- Date: Fri, 17 Nov 2017 21:52:34 -0500
- Subject: [PATCH 02/11] cp_tree::maybe_add_location_wrapper: no-op for template decls
- Authentication-results: sourceware.org; auth=none
- References: <1510350329-48956-1-git-send-email-dmalcolm@redhat.com> <1510973563-10046-1-git-send-email-dmalcolm@redhat.com>
For simplicity, add a gate on !processing_template_decl
to cp_tree::maybe_add_location_wrapper.
gcc/cp/ChangeLog:
* cp-tree.h (cp_expr::maybe_add_location_wrapper): Do nothing if
processing_template_decl.
---
gcc/cp/cp-tree.h | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 03087f0..63e9bff 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -93,11 +93,7 @@ public:
set_location (make_location (m_loc, start, finish));
}
- cp_expr& maybe_add_location_wrapper ()
- {
- m_value = maybe_wrap_with_location (m_value, m_loc);
- return *this;
- }
+ cp_expr& maybe_add_location_wrapper ();
private:
tree m_value;
@@ -1642,6 +1638,16 @@ struct warning_sentinel
~warning_sentinel() { flag = val; }
};
+inline cp_expr&
+cp_expr::maybe_add_location_wrapper ()
+{
+ /* For now, don't add wrappers when processing template decls. */
+ if (!processing_template_decl)
+ m_value = maybe_wrap_with_location (m_value, m_loc);
+ return *this;
+}
+
+
/* The cached class binding level, from the most recently exited
class, or NULL if none. */
--
1.8.5.3