<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 --- - clang is wrongly compiled varadic templates, or sizeof ...(T) construction."
   href="http://llvm.org/bugs/show_bug.cgi?id=16503">16503</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang is wrongly compiled  varadic templates, or sizeof ...(T) construction.
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.2
          </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>khurshid.normuradov@gmail.com
          </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>I compiled following programm, it's success compiled, but wrongly printed
result. I've tested it with GCC 4.8.0 also, it shows right result, but with
CLang 3.2 results is wrongly.

results for
GCC 4.8.0 :  3 4
CLang 3.2 :  3 1


//////////////////////////////////////////
/// source code /////////////////////////
#include <iostream>
#include <type_traits>

template<class T>
void writeln(T const& t){   std::cout << t << std::endl; }

namespace vargs
{
template< class ...T>
using size_of = std::integral_constant< decltype(sizeof...(T)), (sizeof...(T)
)>;
}


namespace mpl
{
    template<class ...T>
    struct tuple
    {
        using type = tuple;
    };

    template< class TP> struct size_of;

    template< class ...T> struct size_of< tuple<T...> > : vargs::size_of<T...>
{};
}

int main(int argc, char * argv[])
{
    auto n = vargs::size_of<int,float,double>::value;

    writeln(n);

    typedef mpl::tuple<int,float,double,char> mytuple;

    auto s = mpl::size_of<mytuple>::value;

    writeln(s);
}
//////////////////////////////////////////////////////////////////////</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>