aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 55f986e..856202c 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2206,6 +2206,8 @@ struct GTY(()) language_function {
BOOL_BITFIELD invalid_constexpr : 1;
BOOL_BITFIELD throwing_cleanup : 1;
+ /* True if we gave any errors in this function. */
+ BOOL_BITFIELD erroneous : 1;
hash_table<named_label_hash> *x_named_labels;
@@ -6753,8 +6755,14 @@ struct GTY((chain_next ("%h.next"))) tinst_level {
/* The location where the template is instantiated. */
location_t locus;
- /* errorcount + sorrycount when we pushed this level. */
- unsigned short errors;
+ /* errorcount + sorrycount when we pushed this level. If the value
+ overflows, it will always seem like we currently have more errors, so we
+ will limit template recursion even from non-erroneous templates. In a TU
+ with over 32k errors, that's fine. */
+ unsigned short errors : 15;
+
+ /* set in pop_tinst_level if there have been errors since we pushed. */
+ bool had_errors : 1;
/* Count references to this object. If refcount reaches
refcount_infinity value, we don't increment or decrement the