Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
3bed46f6
Commit
3bed46f6
authored
Aug 05, 2011
by
Jason Merrill
Committed by
Jason Merrill
Aug 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* pt.c (unify) [TEMPLATE_TYPE_PARM]: Allow VLA for C++0x 'auto'.
From-SVN: r177476
parent
2c331232
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
gcc/cp/ChangeLog
+4
-0
gcc/cp/pt.c
+5
-4
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/ext/vla11.C
+8
-0
No files found.
gcc/cp/ChangeLog
View file @
3bed46f6
2011-08-05 Jason Merrill <jason@redhat.com>
* pt.c (unify) [TEMPLATE_TYPE_PARM]: Allow VLA for C++0x 'auto'.
2011-08-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/49905
...
...
gcc/cp/pt.c
View file @
3bed46f6
...
...
@@ -15932,10 +15932,11 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
that were talking about variable-sized arrays (like
`int[n]'), rather than arrays of unknown size (like
`int[]').) We'll get very confused by such a type since
the bound of the array will not be computable in an
instantiation. Besides, such types are not allowed in
ISO C++, so we can do as we please here. */
if
(
variably_modified_type_p
(
arg
,
NULL_TREE
))
the bound of the array is not constant, and therefore
not mangleable. Besides, such types are not allowed in
ISO C++, so we can do as we please here. We do allow
them for 'auto' deduction, since that isn't ABI-exposed. */
if
(
!
is_auto
(
parm
)
&&
variably_modified_type_p
(
arg
,
NULL_TREE
))
return
unify_vla_arg
(
explain_p
,
arg
);
/* Strip typedefs as in convert_template_argument. */
...
...
gcc/testsuite/ChangeLog
View file @
3bed46f6
2011-08-05 Jason Merrill <jason@redhat.com>
* g++.dg/ext/vla11.C: New.
2011-08-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49984
...
...
gcc/testsuite/g++.dg/ext/vla11.C
0 → 100644
View file @
3bed46f6
// Test that auto works with VLAs.
// { dg-options -std=c++0x }
void
bar
(
int
n
)
{
float
loc2
[
n
];
auto
&&
range
=
loc2
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment