title: Weird "reference to non-static member function must be called" error
body: <p>Why do I get error "reference to non-static member function must be called":</p>
  
  <pre><code>&lt;source&gt;:35:19: error: reference to non-static member function must be called
  
      list_.front().Set&lt;Flags::First&gt;(true);
  
      ~~~~~~~~~~~~~~^~~
  
  &lt;source&gt;:40:10: note: in instantiation of member function 'List&lt;int&gt;::Set' requested here
  
      list.Set();
  
           ^
  
  &lt;source&gt;:13:8: note: possible target for call
  
    void Set(bool value) {
  
         ^
  
  1 error generated.
  
  Compiler returned: 1
  </code></pre>
  
  <p>when I try to compile this code with clang 7.0.0?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;list&gt;
  using namespace std;
  
  enum class Flags : uint8_t {
      First  = 1,
      Second = 2
  };
  
  class Header {
  public:
    template &lt;Flags flag&gt;
    void Set(bool value) {
         flags_ = static_cast&lt;Flags&gt;(
             value
             ? (static_cast&lt;uint8_t&gt;(flags_) | static_cast&lt;uint8_t&gt;(flag))
             : (static_cast&lt;uint8_t&gt;(flags_) &amp; (~static_cast&lt;uint8_t&gt;(flag))));
    }
  
  private:
    Flags flags_{};
  };
  
  template &lt;class T&gt;
  class List {
  public:
      void Set();
  
  private:
      std::list&lt;Header&gt; list_;
  };
  
  template &lt;class T&gt;
  void List&lt;T&gt;::Set() {
      list_.front().Set&lt;Flags::First&gt;(true);
  }
  
  int main() {
      List&lt;int&gt; list;
      list.Set();
      return 0;
  }
  </code></pre>
  
  <p>See here: <a href="https://godbolt.org/z/KXttBb" rel="nofollow noreferrer">https://godbolt.org/z/KXttBb</a></p>