<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 --- - -Wignored-qualifier noisy on common pattern"
   href="http://llvm.org/bugs/show_bug.cgi?id=21348">21348</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-Wignored-qualifier noisy on common pattern
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>chisophugis@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In libraries that make use of vectors, it is common to parametrize the type
"best type for passing a vector as an argument" (generally either T or T&). I
believe this has to do with ABI and calling convention preferences; why this is
done is not the topic of this bug though. This also can extend to Point classes
which thinly wrap a vector.

For example (using int instead of a vector type):

#if ....
typedef int &IntArg;
#else // (assume this branch isn't taken)
typedef int IntArg;
#endif

int foo(const IntArg I) {
  return I * 3;
}

Currently, clang's -Wignored-qualifiers fires on such code due to the const
applying to the &. This means that everywhere that `const IntArg` is used
(which is frequently), -Wignored-qualifiers fires, which is excessively noisy.

I think it would make sense to fire only in the case where the user has
explicitly written a & with a const applied to it.</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>