<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 --- - Lookup of non-dependent name performed in Phase 2"
   href="https://llvm.org/bugs/show_bug.cgi?id=22971">22971</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Lookup of non-dependent name performed in Phase 2
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.6
          </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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sneves@dei.uc.pt
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Take the following example:

namespace ns1 {
  template<typename T>
  constexpr bool f(T const &) { return true; }
}

namespace ns2 {
  template<typename T> struct S {};
}

template<typename = void>
constexpr int g() {
  using ns1::f;
  return f(ns2::S<int>());
}

namespace ns2 {
  template<template<typename> class T, typename U>
  constexpr bool f(T<U> const &) { return false; }
}

static_assert(g(), "");

In GCC and EDG the static_assert does not fail, i.e., g() calls f(T const&).
Clang, on the other hand, appears to examine g() at the instantiation point,
and calls the better fit f(T<U> const&). 

My understanding of the standard is that, since ns2::S<int> is not a dependent
type, the lookup of f() should be performed in the context of g()'s definition
and not of its instantiation. So I think Clang is wrong here.</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>