C++: fix-it hint for missing "typename" (PR c++/63392)
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 27 Aug 2018 23:33:02 +0000 (23:33 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Mon, 27 Aug 2018 23:33:02 +0000 (23:33 +0000)
commitbdd039843c2df9c7ab1ebcd914a70208aaa14c23
tree3c85ac088c15309e8f7b0a515cc378c4e9c35970
parent6a2a69287c6cbcfa31cd9dcb13cfdf40cdd29d8e
C++: fix-it hint for missing "typename" (PR c++/63392)

This patch adds a fix-it hint to missing "typename" errors in the C++
frontend, suggesting the insertion of "typename ".

This addresses part of PR c++/63392; however it does not improve the
error-recovery for such cases.

gcc/cp/ChangeLog:
PR c++/63392
* parser.c (cp_parser_diagnose_invalid_type_name): Add fix-it
hint.

gcc/testsuite/ChangeLog:
PR c++/63392
* g++.dg/diagnostic/missing-typename.C: New test.

From-SVN: r263899
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/missing-typename.C [new file with mode: 0644]