https://bugs.llvm.org/show_bug.cgi?id=40266

            Bug ID: 40266
           Summary: instantiating a non-type class template with
                    no-linkage object as argument cause clang to crash
           Product: clang
           Version: 2.6
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Created attachment 21305
  --> https://bugs.llvm.org/attachment.cgi?id=21305&action=edit
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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to