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
This commit is contained in:
parent
70f961a51e
commit
35385f991f
4 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
2011-01-14 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/46903
|
||||
* typeck2.c (check_narrowing): Only check arithmetic types.
|
||||
|
||||
PR c++/46688
|
||||
* tree.c (build_vec_init_expr): Handle flexible array
|
||||
properly.
|
||||
|
|
|
@ -717,6 +717,9 @@ check_narrowing (tree type, tree init)
|
|||
bool ok = true;
|
||||
REAL_VALUE_TYPE d;
|
||||
|
||||
if (!ARITHMETIC_TYPE_P (type))
|
||||
return;
|
||||
|
||||
init = maybe_constant_value (init);
|
||||
|
||||
if (TREE_CODE (type) == INTEGER_TYPE
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
2011-01-14 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* g++.dg/cpp0x/constexpr-regress1.C: New.
|
||||
|
||||
* g++.dg/ext/flexary2.C: New.
|
||||
|
||||
2011-01-14 Richard Guenther <rguenther@suse.de>
|
||||
|
|
10
gcc/testsuite/g++.dg/cpp0x/constexpr-regress1.C
Normal file
10
gcc/testsuite/g++.dg/cpp0x/constexpr-regress1.C
Normal file
|
@ -0,0 +1,10 @@
|
|||
// 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>};
|
Loading…
Add table
Reference in a new issue