* [pushed] c++: parsing injected-class-name as template
@ 2022-05-15 16:43 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-05-15 16:43 UTC (permalink / raw)
To: gcc-patches
While I was backporting the patch for PR102300, it occurred to me that it
would be cleaner to look through the injected-class-name earlier in the
function. I don't think this changes any test results.
Tested x86_64-pc-linux-gnu, applying to trunk.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_template_name): Look through
injected-class-name.
---
gcc/cp/parser.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 8969ed0076a..d4dab6cf84e 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -18646,6 +18646,9 @@ cp_parser_template_name (cp_parser* parser,
(9.3.4), or in a type-only context other than a nested-name-specifier
(13.8). */
+ /* Handle injected-class-name. */
+ decl = maybe_get_template_decl_from_type_decl (decl);
+
/* If DECL is a template, then the name was a template-name. */
if (TREE_CODE (decl) == TEMPLATE_DECL)
{
base-commit: ce46d6041358052dfa26f3720732f0357c5d72e7
--
2.27.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-15 16:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-15 16:43 [pushed] c++: parsing injected-class-name as template Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).