<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 --- - [QOI] complain about declaration that changes meaning"
   href="http://llvm.org/bugs/show_bug.cgi?id=15559">15559</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[QOI] complain about declaration that changes meaning
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </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>zeratul976@hotmail.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>For the following code:


struct foo {};

struct A
{
    typedef foo foo_type;

    void foo();
};


GCC gives a compiler error:


test.cpp:7:14: error: declaration of 'void A::foo()' [-fpermissive]
     void foo();
              ^
test.cpp:1:8: error: changes meaning of 'foo' from 'struct foo' [-fpermissive]
 struct foo {};
        ^


Clang gives no error. I believe this is covered by section 3.3.7 of the
standard:

"A name N used in a class S shall refer to the same declaration in its context
and when re-evaluated in the completed scope of S. No diagnostic is required
for a violation of this rule."

I am filing this as a quality-of-implementation issue. While no diagnostic is
required, I think it would be a good idea for clang to issue one, seeing as GCC
does.</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>