<html>
    <head>
      <base href="http://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 --- - Wrong partial specialization used with -Wno-c++11-narrowing"
   href="http://llvm.org/bugs/show_bug.cgi?id=16050">16050</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong partial specialization used with -Wno-c++11-narrowing
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>zilla@kayari.org
          </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>This compiles OK with -std=c++03

typedef unsigned long size_t;

template<class T, size_t N = -1>
struct X
{
    T t[N];
};

template<class T>
struct X<T, -1>
{
    T* t;
};

X<int> x;

But with -std=c++11 -Wno-c++11-narrowing I get:

t.cc:6:9: error: array is too large (18446744073709551615 elements)
    T t[N];
        ^
t.cc:15:8: note: in instantiation of template class 'X<int,
18446744073709551615>' requested here
X<int> x;
       ^
1 error generated.


Shouldn't it behave like -std=c++03 when I disable the diagnostics for
narrowing?

Or at least be consistent in the treatment of the two -1 literals, so the
default template argument of -1 matches the partial specialization's argument
of -1</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>