<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 - out-of-line definition does not match any declaration in class (declaration contains expression which involves variable template defined inside the class)"
   href="https://bugs.llvm.org/show_bug.cgi?id=43963">43963</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>out-of-line definition does not match any declaration in class (declaration contains expression which involves variable template defined inside the class)
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Keywords</th>
          <td>compile-fail
          </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>nok.raven@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>template <bool>
struct S {};

struct X {
    enum E { A };

    template<E e>
    inline static constexpr bool q = A == e;

    template <E e>
    S<q<e>>* foo();
    //S<X::q<e>>* foo(); // this one compiles
};

template <X::E e>
S<X::q<e>>* X::foo() {
    return 0;
}

int main() {
    X().foo<X::A>();
}

GCC has problems with this too
<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92459">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92459</a>

<a href="https://godbolt.org/z/Z4nP5k">https://godbolt.org/z/Z4nP5k</a></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>