mirror of git://gcc.gnu.org/git/gcc.git
PR c++/71350 - error recursion with initializer-list
* decl.c (reshape_init_r): Check complain for missing braces warning. From-SVN: r238684
This commit is contained in:
parent
478ed1fae7
commit
a6c690f41e
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-07-23 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/71350
|
||||||
|
* decl.c (reshape_init_r): Check complain for missing braces warning.
|
||||||
|
|
||||||
2016-07-22 Jason Merrill <jason@redhat.com>
|
2016-07-22 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
PR c++/71576
|
PR c++/71576
|
||||||
|
|
|
||||||
|
|
@ -5894,8 +5894,10 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
warning (OPT_Wmissing_braces, "missing braces around initializer for %qT",
|
if (complain & tf_warning)
|
||||||
type);
|
warning (OPT_Wmissing_braces,
|
||||||
|
"missing braces around initializer for %qT",
|
||||||
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dispatch to specialized routines. */
|
/* Dispatch to specialized routines. */
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
// PR c++/71350
|
||||||
|
// { dg-do compile { target c++11 } }
|
||||||
|
|
||||||
|
template<typename T, unsigned int N>
|
||||||
|
struct Array
|
||||||
|
{
|
||||||
|
T data[N];
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
struct Foo
|
||||||
|
{
|
||||||
|
int operator[](const Array<int, 2>& i) const { return 0; }
|
||||||
|
auto bar() -> decltype((*this)[{1,2}] * 0) {
|
||||||
|
return *this; // { dg-error "cannot convert" }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template struct Foo<int>;
|
||||||
Loading…
Reference in New Issue