re PR c++/60277 (Bogus "inline function virtual ..." used but never defined)

PR c++/60277
	* call.c (build_array_conv): Don't crash on VLA.

From-SVN: r208001
This commit is contained in:
Jason Merrill 2014-02-21 09:56:46 -05:00 committed by Jason Merrill
parent 1ea3297452
commit cd3ef6f762
3 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2014-02-21 Jason Merrill <jason@redhat.com>
PR c++/60277
* call.c (build_array_conv): Don't crash on VLA.
PR c++/60248
* mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.

View File

@ -948,7 +948,8 @@ build_array_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
bool user = false;
enum conversion_rank rank = cr_exact;
if (TYPE_DOMAIN (type))
if (TYPE_DOMAIN (type)
&& !variably_modified_type_p (TYPE_DOMAIN (type), NULL_TREE))
{
unsigned HOST_WIDE_INT alen = tree_to_uhwi (array_type_nelts_top (type));
if (alen < len)

View File

@ -0,0 +1,8 @@
// PR c++/60277
// { dg-options "-std=c++1y -pedantic-errors" }
void foo(int n)
{
int a[n];
int (&r)[n] = {}; // { dg-error "" }
}