<html>
    <head>
      <base href="https://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 --- - -Wincompatible-pointer-types-discards-qualifiers should note the particular discarded qualifiers" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23642&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=Rqd7g7qzrVku_EgkYqAqMPAy9sMnr7sQNDSvoJ7DIk0&s=nTW8CjYoUKPXYGQMp02vQhy8rpVeVLZs6jAd8o69fC8&e=">23642</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-Wincompatible-pointer-types-discards-qualifiers should note the particular discarded qualifiers
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jonathan@codesourcery.com
          </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>Clang 3.6 does this:

$ cat cc.c
int main() {
 char * c;
 char const ** c2 = &c;
}
$ clang cc.c
cc.c:3:16: warning: initializing 'const char **' with an expression of type
'char **' discards qualifiers in nested pointer types
[-Wincompatible-pointer-types-discards-qualifiers]
 char const ** c2 = &c;
               ^    ~~
1 warning generated.


It would be very nice if something like this were emitted instead:
cc.c:3:16: warning: initializing 'const char **' with an expression of type
'char **' discards qualifiers in nested pointer types
[-Wincompatible-pointer-types-discards-qualifiers]
 char const ** c2 = &c;
               ^    ~~
cc.c:3:7: note: nested pointer type with discarded 'const' qualifier
 char const ** c2 = &c;
 ---- ^^^^^ -</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>