<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - instantiating a non-type class template with no-linkage object as argument cause clang to crash"
   href="https://bugs.llvm.org/show_bug.cgi?id=40266">40266</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>instantiating a non-type class template with no-linkage object as argument cause clang to crash
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>2.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yazandaba@icloud.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21305" name="attach_21305" title="crash backtrace">attachment 21305</a> <a href="attachment.cgi?id=21305&action=edit" title="crash backtrace">[details]</a></span>
crash backtrace

struct StringObject{
  constexpr StringObject(const char*ptr){}
};

template<StringObject const&stringObject>
struct String{};

int main(){
  String<StringObject{"string"}> obj{};
}


a non-type class template with reference or pointer type must instantiate a
different class templates for each object that get passed to it as an argument
with the above code clang get crashed trying to instantiate a class template
instance with an object with no linkage

****NOTE****: clang is working fine and producing an error with
(-std=c++11,-std=c++14) and don't crash but crash when compiling the code with
(-std=++1z)

the above source code was compiled with only (-std=c++1z) compiler flag</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>