This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50853] New: Internal Compiler Error returning a template type using brace initialization


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50853

             Bug #: 50853
           Summary: Internal Compiler Error returning a template type
                    using brace initialization
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: public@alisdairm.net


The following obscure code produces an ICE when the function template 'test' is
called:


template<int> struct MyType{};

template<int VAL>
auto test(MyType<VAL>) -> MyType<int{VAL}> { return {}; }

int main() {
   MyType<int{256}>{};
   test( MyType<256>{} );  // no error without this call
}

The ICE produced is:

internal compiler error: in tsubst_copy_and_build, at cp/pt.c:13389


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]