<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 - [C++4OpenCL] Inconsistent diagnostics for taking function address"
   href="https://bugs.llvm.org/show_bug.cgi?id=49310">49310</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[C++4OpenCL] Inconsistent diagnostics for taking function address
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>OpenCL
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>anastasia.stulova@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>An inconsistent diagnostic is given when function addresses are taken i.e.
template functions are not diagnosed while normal functions are.

template<class T>
void f1(){}

void f2(){}

void bar(){
    f1<int>;
    f2;//error: taking address of function is not allowed
}

It is not clear though why the diagnostic was added since OpenCL C never
restricted taking addresses of functions. Perhaps it was considered useless
since function pointers can't be used. However, taking an address doesn't imply
that the function will necessarily be called even if it is the most common use
case. In addition to that, the diagnostic is handled in Parser and not Sema
where it conceptually belongs. Potentially we need to see if we can just remove
the diagnostic.</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>