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
be2b93e6
Commit
be2b93e6
authored
Sep 06, 2010
by
Jason Merrill
Committed by
Jason Merrill
Sep 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* decl.c (cp_finish_decl): Don't change init for auto deduction.
From-SVN: r163896
parent
40013af7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
4 deletions
+19
-4
gcc/cp/ChangeLog
+2
-0
gcc/cp/decl.c
+7
-4
gcc/testsuite/ChangeLog
+2
-0
gcc/testsuite/g++.dg/cpp0x/auto19.C
+8
-0
No files found.
gcc/cp/ChangeLog
View file @
be2b93e6
2010-09-06 Jason Merrill <jason@redhat.com>
* decl.c (cp_finish_decl): Don't change init for auto deduction.
* pt.c (fold_non_dependent_expr_sfinae): Split out from...
(fold_non_dependent_expr): ...here.
(convert_nontype_argument): Use it. Take complain parm.
...
...
gcc/cp/decl.c
View file @
be2b93e6
...
...
@@ -5681,18 +5681,21 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
auto_node
=
type_uses_auto
(
type
);
if
(
auto_node
)
{
tree
d_init
;
if
(
init
==
NULL_TREE
)
{
error
(
"declaration of %q#D has no initializer"
,
decl
);
TREE_TYPE
(
decl
)
=
error_mark_node
;
return
;
}
if
(
TREE_CODE
(
init
)
==
TREE_LIST
)
init
=
build_x_compound_expr_from_list
(
init
,
ELK_INIT
,
d_init
=
init
;
if
(
TREE_CODE
(
d_init
)
==
TREE_LIST
)
d_init
=
build_x_compound_expr_from_list
(
d_init
,
ELK_INIT
,
tf_warning_or_error
);
if
(
describable_type
(
init
))
if
(
describable_type
(
d_
init
))
{
type
=
TREE_TYPE
(
decl
)
=
do_auto_deduction
(
type
,
init
,
auto_node
);
type
=
TREE_TYPE
(
decl
)
=
do_auto_deduction
(
type
,
d_init
,
auto_node
);
if
(
type
==
error_mark_node
)
return
;
}
...
...
gcc/testsuite/ChangeLog
View file @
be2b93e6
2010-09-06 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/auto19.C: New.
* g++.dg/template/sfinae25.C: New.
* g++.dg/template/char1.C: Expect warning.
* g++.dg/template/nontype10.C: Likewise.
...
...
gcc/testsuite/g++.dg/cpp0x/auto19.C
0 → 100644
View file @
be2b93e6
// { dg-options -std=c++0x }
struct
Explicit
{
Explicit
()
=
default
;
// Line 2
explicit
Explicit
(
const
Explicit
&
){}
}
ex
;
auto
ex2
(
ex
);
// Line 6
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