c++: add "'requires' only available with ..." note
authorPatrick Palka <ppalka@redhat.com>
Sat, 25 Apr 2020 01:16:59 +0000 (21:16 -0400)
committerPatrick Palka <ppalka@redhat.com>
Sat, 25 Apr 2020 01:16:59 +0000 (21:16 -0400)
commit5e7e8b98f49eda9ffb9817d97975a211c87c5a53
tree1f66407215327fc43c4a91aed1623e9ef015abf4
parent018730326d878d98b85b1256ff220e76665ed97e
c++: add "'requires' only available with ..." note

This adds a note suggesting to enable concepts whenever 'requires' is parsed as
an invalid type name with concepts disabled.

gcc/cp/ChangeLog:

* parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
concepts if the invalid identifier is 'requires'.

gcc/testsuite/ChangeLog:

* g++.dg/concepts/diagnostic11.C: New test.
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/diagnostic11.C [new file with mode: 0644]