This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/62314] New: Fix-it Hints
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 30 Aug 2014 17:19:32 +0000
- Subject: [Bug c++/62314] New: Fix-it Hints
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62314
Bug ID: 62314
Summary: Fix-it Hints
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: manu at gcc dot gnu.org
Created attachment 33421
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33421&action=edit
fixit-hints draft implementation
Quoting from http://clang.llvm.org/diagnostics.html
"Fix-it" hints provide advice for fixing small, localized problems in source
code. When Clang produces a diagnostic about a particular problem that it can
work around (e.g., non-standard or redundant syntax, missing keywords, common
mistakes, etc.), it may also provide specific guidance in the form of a code
transformation to correct the problem.
$ clang t.cpp
t.cpp:9:3: error: template specialization requires 'template<>'
struct iterator_traits<file_iterator> {
^
template<>
The attached patch implements the same behavior for GCC when given
-fdiagnostic-show-caret. When the caret is disabled, it gives:
t.cpp:9:3: error: template specialization requires 'template<>'
t.cpp:9:3: fixit: template<>
so an IDE might parse the "fixit:" diagnostic and use the message to edit the
text directly.
This is work in progress I have not even tried to build gcc using this patch.