<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 --- - Typedef return type + Fully Qualified name for a member function causes error in out-of-line definition"
   href="https://llvm.org/bugs/show_bug.cgi?id=25182">25182</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Typedef return type + Fully Qualified name for a member function causes error in out-of-line definition
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.7
          </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>a@gha.st
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When defining a member function out of line with its fully qualified name and a
return type that is a type alias, clang will cause an error.

Consider the following example:

// compiled with clang++ -std=c++14 file.cpp
using test_t = int;

struct S { test_t f(); };

// This will error out with:
// error: 'test_t' (aka 'int') is not a class, namespace, or enumeration
test_t ::S::f() { return 0; }

// Defining it like this will compile correctly:
// test_t S::f() { return 0; }

// The following also works:
// int ::S::f() { return 0; }


// a main function so it links correctly:
int main() { }


This bug appears with both the following clang++ versions:

$ clang++ -v
clang version 3.7.0 (tags/RELEASE_370/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation:
/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0
Found candidate GCC installation:
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0
Found candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/5.2.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64


$ clang++ -v
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin15.0.0
Thread model: posix</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>