Bug 43321 - [c++0x] ICE on valid auto
Summary: [c++0x] ICE on valid auto
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-10 15:08 UTC by Ádám Rák
Modified: 2011-06-20 14:54 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux
Target: x86_64-unknown-linux
Build: x86_64-unknown-linux
Known to work:
Known to fail:
Last reconfirmed: 2010-03-10 15:43:52


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ádám Rák 2010-03-10 15:08:27 UTC
I hope it's a valid "auto". the code works if I write "int" instead of "auto".

It might be related to Bug 43281

internal compiler error: in type_unification_real, at cp/pt.c:13486

template <typename T >
void shuffle(const T& first, const T& last)
{
    auto w = *first;
}

int main()
{
  int b[5];
  shuffle(&b[0],&b[4]);
}

g++-4.5 -v
Using built-in specs.
COLLECT_GCC=g++-4.5
COLLECT_LTO_WRAPPER=/home/rakadam/streamplusplus/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-languages=c,c++ --program-suffix=-4.5 --prefix=/home/rakadam/streamplusplus/src/third_party/gcc-trunk/build_gcc/../../../../local --enable-lto --disable-bootstrap --enable-gold
Thread model: posix
gcc version 4.5.0 20100306 (experimental) (GCC)
Comment 1 Jason Merrill 2010-03-10 15:43:52 UTC
Yes, that's valid.
Comment 2 Jason Merrill 2011-06-20 14:39:56 UTC
Author: jason
Date: Mon Jun 20 14:39:53 2011
New Revision: 175212

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175212
Log:
	PR c++/43321
	* semantics.c (describable_type): Remove.
	* cp-tree.h: Likewise.
	* decl.c (cp_finish_decl): Don't call it.
	* init.c (build_new): Likewise.
	* parser.c (cp_parser_omp_for_loop): Likewise.
	* pt.c (tsubst_decl): Likewise.
	(do_auto_deduction): If we fail in a template, try again
	at instantiation time.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/auto26.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/init.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Jason Merrill 2011-06-20 14:54:13 UTC
Fixed for 4.7.0.