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
a0685b73
Commit
a0685b73
authored
May 19, 2010
by
Jason Merrill
Committed by
Jason Merrill
May 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* typeck.c (merge_types): Preserve memfn quals.
From-SVN: r159598
parent
93e1ddcf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
11 deletions
+27
-11
gcc/cp/ChangeLog
+2
-0
gcc/cp/typeck.c
+16
-11
gcc/testsuite/ChangeLog
+2
-0
gcc/testsuite/g++.dg/parse/fn-typedef2.C
+7
-0
No files found.
gcc/cp/ChangeLog
View file @
a0685b73
2010-05-19 Jason Merrill <jason@redhat.com>
* typeck.c (merge_types): Preserve memfn quals.
* decl.c (grokdeclarator): Don't check quals on fn type.
* typeck.c (cp_apply_type_quals_to_decl): Likewise.
* tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
...
...
gcc/cp/typeck.c
View file @
a0685b73
...
...
@@ -810,6 +810,7 @@ merge_types (tree t1, tree t2)
tree
valtype
=
merge_types
(
TREE_TYPE
(
t1
),
TREE_TYPE
(
t2
));
tree
p1
=
TYPE_ARG_TYPES
(
t1
);
tree
p2
=
TYPE_ARG_TYPES
(
t2
);
tree
parms
;
tree
rval
,
raises
;
/* Save space: see if the result is identical to one of the args. */
...
...
@@ -821,21 +822,25 @@ merge_types (tree t1, tree t2)
/* Simple way if one arg fails to specify argument types. */
if
(
p1
==
NULL_TREE
||
TREE_VALUE
(
p1
)
==
void_type_node
)
{
rval
=
build_function_type
(
valtype
,
p2
);
if
((
raises
=
TYPE_RAISES_EXCEPTIONS
(
t2
)))
rval
=
build_exception_variant
(
rval
,
raises
);
return
cp_build_type_attribute_variant
(
rval
,
attributes
);
parms
=
p2
;
raises
=
TYPE_RAISES_EXCEPTIONS
(
t2
);
}
raises
=
TYPE_RAISES_EXCEPTIONS
(
t1
);
if
(
p2
==
NULL_TREE
||
TREE_VALUE
(
p2
)
==
void_type_node
)
else
if
(
p2
==
NULL_TREE
||
TREE_VALUE
(
p2
)
==
void_type_node
)
{
rval
=
build_function_type
(
valtype
,
p1
);
if
(
raises
)
rval
=
build_exception_variant
(
rval
,
raises
);
return
cp_build_type_attribute_variant
(
rval
,
attributes
);
parms
=
p1
;
raises
=
TYPE_RAISES_EXCEPTIONS
(
t1
);
}
else
{
parms
=
commonparms
(
p1
,
p2
);
/* In cases where we're merging a real declaration with a
built-in declaration, t1 is the real one. */
raises
=
TYPE_RAISES_EXCEPTIONS
(
t1
);
}
rval
=
build_function_type
(
valtype
,
commonparms
(
p1
,
p2
));
rval
=
build_function_type
(
valtype
,
parms
);
gcc_assert
(
type_memfn_quals
(
t1
)
==
type_memfn_quals
(
t2
));
rval
=
apply_memfn_quals
(
rval
,
type_memfn_quals
(
t1
));
t1
=
build_exception_variant
(
rval
,
raises
);
break
;
}
...
...
gcc/testsuite/ChangeLog
View file @
a0685b73
2010-05-19 Jason Merrill <jason@redhat.com>
* g++.dg/parse/fn-typedef2.C: New.
* g++.dg/other/cv_func.C: Don't expect errors about cv-qualified
function type.
...
...
gcc/testsuite/g++.dg/parse/fn-typedef2.C
0 → 100644
View file @
a0685b73
// Test that merge_types preserves fn cv-quals.
typedef
void
ft
()
const
;
typedef
void
V
;
typedef
V
ft
()
const
;
ft
f
;
// { dg-error "qualified" }
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