title: What should `foo.template bar()` do when there's both a template and a non-template overload?
body: <p>A coworker shared this code with me:</p>
  <p><kbd><a href="https://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:%271%27,fontScale:14,fontUsePx:%270%27,j:1,lang:c%2B%2B,selection:(endColumn:19,endLineNumber:14,positionColumn:19,positionLineNumber:14,selectionStartColumn:19,selectionStartLineNumber:14,startColumn:19,startLineNumber:14),source:%27%23include+%3Ciostream%3E%0A%0Astruct+A%0A%7B%0A++++void+foo()+%7Bstd::cout+%3C%3C+%221%5Cn%22%3B%7D%0A%0A++++template+%3Ctypename+T+%3D+int%3E%0A++++void+foo()+%7Bstd::cout+%3C%3C+%222%5Cn%22%3B%7D%0A%7D%3B%0A%0Aint+main()%0A%7B%0A++++A+x%3B%0A++++x.template+foo()%3B%0A%7D%27),l:%275%27,n:%270%27,o:%27C%2B%2B+source+%231%27,t:%270%27)),k:43.28981723237598,l:%274%27,n:%270%27,o:%27%27,s:0,t:%270%27),(g:!((g:!((h:compiler,i:(compiler:clang1300,filters:(b:%270%27,binary:%271%27,commentOnly:%270%27,demangle:%270%27,directives:%270%27,execute:%270%27,intel:%270%27,libraryCode:%270%27,trim:%271%27),flagsViewOpen:%271%27,fontScale:14,fontUsePx:%270%27,j:2,lang:c%2B%2B,libs:!(),options:%27-std%3Dc%2B%2B20+-Wall+-Wextra+-pedantic-errors%27,selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1,tree:%271%27),l:%275%27,n:%270%27,o:%27x86-64+clang+13.0.0+(C%2B%2B,+Editor+%231,+Compiler+%232)%27,t:%270%27)),header:(),k:29.623619985624018,l:%274%27,m:49.21700223713646,n:%270%27,o:%27%27,s:0,t:%270%27),(g:!((h:output,i:(compiler:2,editor:1,fontScale:14,fontUsePx:%270%27,tree:%271%27,wrap:%271%27),l:%275%27,n:%270%27,o:%27Output+of+x86-64+clang+13.0.0+(Compiler+%232)%27,t:%270%27)),header:(),l:%274%27,m:50.78299776286354,n:%270%27,o:%27%27,s:0,t:%270%27)),k:56.71018276762404,l:%273%27,n:%270%27,o:%27%27,t:%270%27)),l:%272%27,n:%270%27,o:%27%27,t:%270%27)),version:4" rel="noreferrer">run on gcc.godbolt.org</a></kbd></p>
  <pre><code>#include &lt;iostream&gt;
  
  struct A
  {
      void foo() {std::cout &lt;&lt; &quot;1\n&quot;;}
      
      template &lt;typename T = int&gt;
      void foo() {std::cout &lt;&lt; &quot;2\n&quot;;}
  };
  
  int main()
  {
      A x;
      x.template foo();
  }
  </code></pre>
  <p>GCC prints <code>1</code>, Clang prints <code>2</code>, and MSVC complains about missing template arguments.</p>
  <p>Which compiler is correct?</p>