<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 --- - bug with variadic class friend functions"
   href="https://llvm.org/bugs/show_bug.cgi?id=25288">25288</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>bug with variadic class friend functions
          </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++14
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ryan.burn@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The below code compiles fine with gcc and EDG, but gives this error with clang:

rnburn@localhost ~/test/friend_auto $ c++14 t.cpp 
t.cpp:18:3: error: call to 'f' is ambiguous
  f(a);
  ^
t.cpp:6:15: note: candidate function [with Qx = <int, double>]
  friend auto f(A<Qx...> a);
              ^
t.cpp:12:6: note: candidate function [with Qx = <int, double>]
auto f(A<Qx...> a) {
     ^
1 error generated.

///////////////////////////////////////////////////////////////
template<class... Tx>                                                           
class A {                                                                       
 public:                                                                        
  A(int xx) : x(xx) {}                                                          
  template<class... Qx>                                                         
  friend auto f(A<Qx...> a);                                                    
 private:                                                                       
  int x;                                                                        
};                                                                              

template<class... Qx>                                                           
auto f(A<Qx...> a) {                                                            
  return a.x;                                                                   
}                                                                               

int main() {                                                                    
  A<int, double> a(22);                                                         
  f(a);                                                                         
  return 0;                                                                     
}
///////////////////////////////////////////////////////////////</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>