[Bug c++/40306] New: ICE when using auto to declare a local copy inside a member function

public at alisdairm dot net gcc-bugzilla@gcc.gnu.org
Sat May 30 14:31:00 GMT 2009


Tested on MinGW 4.4.0

The following code produces an Internal Compiler Error:

template< typename T >
struct test {
   test run() {
      auto tmp = *this;
      return tmp;
   }
};

int main()
{
   test<int> x;
   x.run();
   return 0;
}


Compiler output:

||=== AutoBug01, Debug ===|
In member function 'test<T> test<T>::run()':
error: in type_unification_real, at cp/pt.c:12477|
||=== Build finished: 1 errors, 0 warnings ===|


-- 
           Summary: ICE when using auto to declare a local copy inside a
                    member function
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: public at alisdairm dot net


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



More information about the Gcc-bugs mailing list