<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Wrong result of TypeName::getFullyQualifiedName(...) for function pointer types"
   href="https://bugs.llvm.org/show_bug.cgi?id=41210">41210</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong result of TypeName::getFullyQualifiedName(...) for function pointer types
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>8.0
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>simon.schroeder@tu-dortmund.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>benny.kra@gmail.com, htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk, simon.schroeder@tu-dortmund.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Similiar to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Wrong result of TypeName::getFullyQualifiedName(...) for member pointer types with WithGlobalNsPrefix=true"
   href="show_bug.cgi?id=40732">bug 40732</a>, there is another problem with
TypeName::getFullyQualifiedName. The problem is, that it does not fully qualify
arguments and result types of function pointers. With elaborated argument or
result types, not only the global namespace specifier is missing, but also
nested namespace specifiers.

Example:
Consider the following code:
  namespace N {
    class C { 
     public:
      class C2 { };
    };
    void foo() {
      C::C2& (*bar)(C* a, C::C2& b);
    }
  }
  int main() {
      N::foo();
  }

getFullyQualifiedName's result for bar's type (independent of
WithGlobalNsPrefix's value) is "C::C2 &(*)(N::C *, C::C2 &)". The type string
of the first argument's type is missing the global namespace specifier. The
type string for the second argument's type as well as the type string for the
result's type lack the nested name specifier for namespace "N" and the global
namespace. The expected result with WithGlobalNsPrefix set to true would be:
::N::C::C2 &(*)(::N::C *, ::N::C::C2 &)
The expected result with WithGlobalNsPrefix set to false would be:
N::C::C2 &(*)(N::C *, N::C::C2 &)

Therefore, getFullyQualifiedName's result with both WithGlobalNsPrefix set to
true or false is not correct.</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>