Commit a6c690f4 by Jason Merrill Committed by Jason Merrill

PR c++/71350 - error recursion with initializer-list

	* decl.c (reshape_init_r): Check complain for missing braces warning.

From-SVN: r238684
parent 478ed1fa
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>
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",
type);
if (complain & tf_warning)
warning (OPT_Wmissing_braces,
"missing braces around initializer for %qT",
type);
}
/* Dispatch to specialized routines. */
......
// 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>;
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