Commit 35385f99 by Jason Merrill Committed by Jason Merrill

re PR c++/46903 ([C++0x] ICE unexpected expression of kind template_id_expr)

	PR c++/46903
	* typeck2.c (check_narrowing): Only check arithmetic types.

From-SVN: r168783
parent 70f961a5
2011-01-14 Jason Merrill <jason@redhat.com> 2011-01-14 Jason Merrill <jason@redhat.com>
PR c++/46903
* typeck2.c (check_narrowing): Only check arithmetic types.
PR c++/46688 PR c++/46688
* tree.c (build_vec_init_expr): Handle flexible array * tree.c (build_vec_init_expr): Handle flexible array
properly. properly.
......
...@@ -717,6 +717,9 @@ check_narrowing (tree type, tree init) ...@@ -717,6 +717,9 @@ check_narrowing (tree type, tree init)
bool ok = true; bool ok = true;
REAL_VALUE_TYPE d; REAL_VALUE_TYPE d;
if (!ARITHMETIC_TYPE_P (type))
return;
init = maybe_constant_value (init); init = maybe_constant_value (init);
if (TREE_CODE (type) == INTEGER_TYPE if (TREE_CODE (type) == INTEGER_TYPE
......
2011-01-14 Jason Merrill <jason@redhat.com> 2011-01-14 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/constexpr-regress1.C: New.
* g++.dg/ext/flexary2.C: New. * g++.dg/ext/flexary2.C: New.
2011-01-14 Richard Guenther <rguenther@suse.de> 2011-01-14 Richard Guenther <rguenther@suse.de>
......
// PR c++/46903
// This isn't C++0x code, but it was breaking in C++0x mode.
// { dg-options -std=c++0x }
struct A {};
struct B {
void *(*a)();
};
template <typename T> void *CreateA() {}
B b = {CreateA<A>};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment