<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - fix-it display in text diagnostics is difficult to read and understand"
   href="http://llvm.org/bugs/show_bug.cgi?id=19485">19485</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fix-it display in text diagnostics is difficult to read and understand
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12410" name="attach_12410" title="possible alternative output style">attachment 12410</a> <a href="attachment.cgi?id=12410&action=edit" title="possible alternative output style">[details]</a></span>
possible alternative output style

Users frequently have issues understanding what fix-it hints mean, or even
noticing they're present. In particular:
 * when the caret points somewhere other than where text should be inserted,
users often have a hard time understanding where the insert should be made
 * there is no visible difference between a fix-it saying to insert "const"
after a semicolon and one saying to insert " const" before a semicolon

A file demonstrating one possible diagnostic output style (modeled after
unified diffs) is attached (with ANSI color codes). The same output without
colors is:

<stdin>:2:3: warning: 'constexpr' specifier is incompatible with C++98
[-Wc++98-compat]
   constexpr int getSize();
   ^~~~~~~~~
<stdin>:2:17: warning: 'constexpr' non-static member function will not be
implicitly 'const' in C++1y; add 'const' to avoid a change in behavior
[-Wconstexpr-not-const]
-  constexpr int getSize();
+  constexpr int getSize() const;
                 ^
<stdin>:3:3: warning: 'constexpr' specifier is incompatible with C++98
[-Wc++98-compat]
   constexpr int n;
   ^~~~~~~~~
<stdin>:3:3: error: non-static data member cannot be constexpr; did you intend
to make it const?
-  constexpr int n;
+  const int n;
             ^
<stdin>:4:3: warning: 'const' type qualifier on return type has no effect
[-Wignored-qualifiers]
-  const int f();
+  int f();
   ^   ~~~
4 warnings and 1 error generated.




Input file and current Clang output:

struct S {
  constexpr int getSize();
  constexpr int n;
  const int f();
};



<stdin>:2:3: warning: 'constexpr' specifier is incompatible with C++98
[-Wc++98-compat]
  constexpr int getSize();
  ^
<stdin>:2:17: warning: 'constexpr' non-static member function will not be
implicitly 'const' in C++1y; add 'const' to avoid a change in behavior
      [-Wconstexpr-not-const]
  constexpr int getSize();
                ^
                          const
<stdin>:3:3: warning: 'constexpr' specifier is incompatible with C++98
[-Wc++98-compat]
  constexpr int n;
  ^
<stdin>:3:3: error: non-static data member cannot be constexpr; did you intend
to make it const?
  constexpr int n;
  ^~~~~~~~~
  const
<stdin>:4:3: warning: 'const' type qualifier on return type has no effect
[-Wignored-qualifiers]
  const int f();
  ^~~~~~
4 warnings and 1 error generated.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>