aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-05-14 08:04:59 -0700
committerNathan Sidwell <nathan@acm.org>2020-05-14 08:06:35 -0700
commit68f1d74ff92c0579981b615335456e0578af6e32 (patch)
treeb11d1d6a9c45ccf69f24e01a2f9621cbbb5d99c0
parentf497e36ae56f0f22b1d60171509c75f7b11f8663 (diff)
downloadgcc-68f1d74ff92c0579981b615335456e0578af6e32.zip
gcc-68f1d74ff92c0579981b615335456e0578af6e32.tar.gz
gcc-68f1d74ff92c0579981b615335456e0578af6e32.tar.bz2
c++: Missed c++2a->20 change
Jason missed a c++2a mention. I couldn't resist changing the loop following to place the initializers inside the fors. * parser.c (cp_parser_diagnose_invalid_typename): Mention std=c++20 not 2a, reformat dependent binfo inform loops.
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/parser.c20
2 files changed, 10 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bcae21c..ba0d9e6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2020-05-14 Nathan Sidwell <nathan@acm.org>
+ * parser.c (cp_parser_diagnose_invalid_typename): Mention
+ std=c++20 not 2a, reformat dependent binfo inform loops.
+
* pt.c (tsubst_template_decl): Reorder and commonize some control
paths.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index bc1ee21..41712bf 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -3376,41 +3376,35 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id,
inform (location, "%<concept%> only available with %<-std=c++20%> or "
"%<-fconcepts%>");
else if (!flag_concepts && id == ridpointers[(int)RID_REQUIRES])
- inform (location, "%<requires%> only available with %<-std=c++2a%> or "
+ inform (location, "%<requires%> only available with %<-std=c++20%> or "
"%<-fconcepts%>");
else if (processing_template_decl && current_class_type
&& TYPE_BINFO (current_class_type))
{
- tree b;
-
- for (b = TREE_CHAIN (TYPE_BINFO (current_class_type));
- b;
- b = TREE_CHAIN (b))
+ for (tree b = TREE_CHAIN (TYPE_BINFO (current_class_type));
+ b; b = TREE_CHAIN (b))
{
tree base_type = BINFO_TYPE (b);
if (CLASS_TYPE_P (base_type)
&& dependent_type_p (base_type))
{
- tree field;
/* Go from a particular instantiation of the
template (which will have an empty TYPE_FIELDs),
to the main version. */
base_type = CLASSTYPE_PRIMARY_TEMPLATE_TYPE (base_type);
- for (field = TYPE_FIELDS (base_type);
- field;
- field = DECL_CHAIN (field))
+ for (tree field = TYPE_FIELDS (base_type);
+ field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == TYPE_DECL
&& DECL_NAME (field) == id)
{
inform (location,
"(perhaps %<typename %T::%E%> was intended)",
BINFO_TYPE (b), id);
- break;
+ goto found;
}
- if (field)
- break;
}
}
+ found:;
}
}
/* Here we diagnose qualified-ids where the scope is actually correct,