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
0ab71f30
Commit
0ab71f30
authored
Aug 25, 2011
by
Jason Merrill
Committed by
Jason Merrill
Aug 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* call.c (convert_like_real): Remove redundant complain checks.
From-SVN: r178082
parent
7888350f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
36 deletions
+26
-36
gcc/cp/ChangeLog
+2
-0
gcc/cp/call.c
+24
-36
No files found.
gcc/cp/ChangeLog
View file @
0ab71f30
2011-08-25 Jason Merrill <jason@redhat.com>
* call.c (convert_like_real): Remove redundant complain checks.
PR c++/50157
* call.c (convert_like_real): Exit early if bad and !tf_error.
...
...
gcc/cp/call.c
View file @
0ab71f30
...
...
@@ -5733,11 +5733,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
empty list, since that is handled separately in 8.5.4. */
&&
cand
->
num_convs
>
0
)
{
if
(
complain
&
tf_error
)
error
(
"converting to %qT from initializer list would use "
"explicit constructor %qD"
,
totype
,
convfn
);
else
return
error_mark_node
;
error
(
"converting to %qT from initializer list would use "
"explicit constructor %qD"
,
totype
,
convfn
);
}
/* Set user_conv_p on the argument conversions, so rvalue/base
...
...
@@ -5789,6 +5786,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
}
return
expr
;
case
ck_ambig
:
/* We leave bad_p off ck_ambig because overload resolution considers
it valid, it just fails when we try to perform it. So we need to
check complain here, too. */
if
(
complain
&
tf_error
)
{
/* Call build_user_type_conversion again for the error. */
...
...
@@ -5899,14 +5899,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
/* Copy-list-initialization doesn't actually involve a copy. */
return
expr
;
expr
=
build_temp
(
expr
,
totype
,
flags
,
&
diag_kind
,
complain
);
if
(
diag_kind
&&
fn
)
{
if
((
complain
&
tf_error
))
emit_diagnostic
(
diag_kind
,
DECL_SOURCE_LOCATION
(
fn
),
0
,
" initializing argument %P of %qD"
,
argnum
,
fn
);
else
if
(
diag_kind
==
DK_ERROR
)
return
error_mark_node
;
}
if
(
diag_kind
&&
fn
&&
complain
)
emit_diagnostic
(
diag_kind
,
DECL_SOURCE_LOCATION
(
fn
),
0
,
" initializing argument %P of %qD"
,
argnum
,
fn
);
return
build_cplus_new
(
totype
,
expr
,
complain
);
case
ck_ref_bind
:
...
...
@@ -5916,13 +5911,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
if
(
convs
->
bad_p
&&
TYPE_REF_IS_RVALUE
(
ref_type
)
&&
real_lvalue_p
(
expr
))
{
if
(
complain
&
tf_error
)
{
error
(
"cannot bind %qT lvalue to %qT"
,
TREE_TYPE
(
expr
),
totype
);
if
(
fn
)
error
(
" initializing argument %P of %q+D"
,
argnum
,
fn
);
}
error
(
"cannot bind %qT lvalue to %qT"
,
TREE_TYPE
(
expr
),
totype
);
if
(
fn
)
error
(
" initializing argument %P of %q+D"
,
argnum
,
fn
);
return
error_mark_node
;
}
...
...
@@ -5948,19 +5940,16 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
if
(
!
CP_TYPE_CONST_NON_VOLATILE_P
(
type
)
&&
!
TYPE_REF_IS_RVALUE
(
ref_type
))
{
if
(
complain
&
tf_error
)
{
/* If the reference is volatile or non-const, we
cannot create a temporary. */
if
(
lvalue
&
clk_bitfield
)
error
(
"cannot bind bitfield %qE to %qT"
,
expr
,
ref_type
);
else
if
(
lvalue
&
clk_packed
)
error
(
"cannot bind packed field %qE to %qT"
,
expr
,
ref_type
);
else
error
(
"cannot bind rvalue %qE to %qT"
,
expr
,
ref_type
);
}
/* If the reference is volatile or non-const, we
cannot create a temporary. */
if
(
lvalue
&
clk_bitfield
)
error
(
"cannot bind bitfield %qE to %qT"
,
expr
,
ref_type
);
else
if
(
lvalue
&
clk_packed
)
error
(
"cannot bind packed field %qE to %qT"
,
expr
,
ref_type
);
else
error
(
"cannot bind rvalue %qE to %qT"
,
expr
,
ref_type
);
return
error_mark_node
;
}
/* If the source is a packed field, and we must use a copy
...
...
@@ -5973,9 +5962,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
&&
CLASS_TYPE_P
(
type
)
&&
type_has_nontrivial_copy_init
(
type
))
{
if
(
complain
&
tf_error
)
error
(
"cannot bind packed field %qE to %qT"
,
expr
,
ref_type
);
error
(
"cannot bind packed field %qE to %qT"
,
expr
,
ref_type
);
return
error_mark_node
;
}
if
(
lvalue
&
clk_bitfield
)
...
...
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