This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 02/11] cp_tree::maybe_add_location_wrapper: no-op for template decls


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]