title: gcc instantiates template with long instead of __int128
body: <p>I am dazed and confused. What is happening here in the second call to my <code>big</code> template?</p>
  
  <pre><code>template &lt;class T&gt; void big(T t) {  }
  
  int main()
  {
      big(9223372036854775808);                        // calls big&lt;__int128&gt;
      big(941832094813209483120);                      // calls big&lt;long&gt;
      big(239120938091238093219203810293801923832019); // calls big&lt;__int128&gt;
  }
  </code></pre>
  
  <p>Why is a <strong>long template</strong> instantiated for <code>941832094813209483120</code>, while the two other values get a <strong>__int128 template</strong>.</p>
  
  <p>This value obviously does <strong>not</strong> fit inside the <code>long</code> and seems to result in an overflow (see full gdb session below):</p>
  
  <pre><code>big&lt;long&gt; (t=1048147054022350704) at blob.cpp:1
  </code></pre>
  
  <p>I observe this with <code>gcc-5.2.0</code> as well as <code>gcc-4.9.2</code>, while I use <code>gdb-7.7.1</code> for debugging.</p>
  
  <p>This is my full <code>gdb</code> session:</p>
  
  <pre><code>Breakpoint 1, main () at blob.cpp:5
  (gdb) s 
  big&lt;__int128&gt; (t=0x00000000000000008000000000000000) at blob.cpp:1
  (gdb)  
  main () at blob.cpp:6
  (gdb)  
  big&lt;long&gt; (t=1048147054022350704) at blob.cpp:1
  (gdb)  
  main () at blob.cpp:7
  (gdb)  
  big&lt;__int128&gt; (t=0x0000000000000000d90567828f8ae8d3) at blob.cpp:1
  (gdb)
  </code></pre>