<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 - member functions shadow template arguments resulting in "reference to non-static member function must be called" error"
   href="https://bugs.llvm.org/show_bug.cgi?id=41309">41309</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>member functions shadow template arguments resulting in "reference to non-static member function must be called" error
          </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>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>peter@pcc.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We reject

$ cat template-test.cpp 
struct S {
  template <bool foo> void f();
  void foo();
};

template <bool foo> void S::f() {
  bool b = foo;
}

void instantiate() {
  S s;
  s.f<true>();
}

with:

template-test.cpp:7:12: error: reference to non-static member function must be
called; did you mean to call it with no arguments?
  bool b = foo;
           ^~~
              ()
template-test.cpp:7:8: error: cannot initialize a variable of type 'bool' with
an rvalue of type 'void'
  bool b = foo;
       ^   ~~~
2 errors generated.

gcc/MSVC/icc all seem to accept it. I haven't checked the standard to see
whether we're getting this right and all the other compilers are getting it
wrong, but I'd be surprised if that were the case.</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>