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
0d3128d6
Commit
0d3128d6
authored
Jul 04, 2011
by
Jason Merrill
Committed by
Jason Merrill
Jul 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* error.c (type_to_string): Avoid redundant akas.
From-SVN: r175833
parent
bc947511
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
0 deletions
+37
-0
gcc/cp/ChangeLog
+4
-0
gcc/cp/error.c
+14
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/diagnostic/aka1.C
+15
-0
No files found.
gcc/cp/ChangeLog
View file @
0d3128d6
2011-07-04 Jason Merrill <jason@redhat.com>
* error.c (type_to_string): Avoid redundant akas.
2011-07-01 Jonathan Wakely <jwakely.gcc@gmail.com>
2011-07-01 Jonathan Wakely <jwakely.gcc@gmail.com>
PR c++/49605
PR c++/49605
...
...
gcc/cp/error.c
View file @
0d3128d6
...
@@ -2634,14 +2634,28 @@ type_to_string (tree typ, int verbose)
...
@@ -2634,14 +2634,28 @@ type_to_string (tree typ, int verbose)
reinit_cxx_pp
();
reinit_cxx_pp
();
dump_type
(
typ
,
flags
);
dump_type
(
typ
,
flags
);
/* If we're printing a type that involves typedefs, also print the
stripped version. But sometimes the stripped version looks
exactly the same, so we don't want it after all. To avoid printing
it in that case, we play ugly obstack games. */
if
(
typ
&&
TYPE_P
(
typ
)
&&
typ
!=
TYPE_CANONICAL
(
typ
)
if
(
typ
&&
TYPE_P
(
typ
)
&&
typ
!=
TYPE_CANONICAL
(
typ
)
&&
!
uses_template_parms
(
typ
))
&&
!
uses_template_parms
(
typ
))
{
{
int
aka_start
;
char
*
p
;
struct
obstack
*
ob
=
pp_base
(
cxx_pp
)
->
buffer
->
obstack
;
/* Remember the end of the initial dump. */
int
len
=
obstack_object_size
(
ob
);
tree
aka
=
strip_typedefs
(
typ
);
tree
aka
=
strip_typedefs
(
typ
);
pp_string
(
cxx_pp
,
" {aka"
);
pp_string
(
cxx_pp
,
" {aka"
);
pp_cxx_whitespace
(
cxx_pp
);
pp_cxx_whitespace
(
cxx_pp
);
/* And remember the start of the aka dump. */
aka_start
=
obstack_object_size
(
ob
);
dump_type
(
aka
,
flags
);
dump_type
(
aka
,
flags
);
pp_character
(
cxx_pp
,
'}'
);
pp_character
(
cxx_pp
,
'}'
);
p
=
(
char
*
)
obstack_base
(
ob
);
/* If they are identical, cut off the aka with a NUL. */
if
(
memcmp
(
p
,
p
+
aka_start
,
len
)
==
0
)
p
[
len
]
=
'\0'
;
}
}
return
pp_formatted_text
(
cxx_pp
);
return
pp_formatted_text
(
cxx_pp
);
}
}
...
...
gcc/testsuite/ChangeLog
View file @
0d3128d6
2011-07-04 Jason Merrill <jason@redhat.com>
* g++.dg/diagnostic/aka1.C: New.
2011-07-04 Jakub Jelinek <jakub@redhat.com>
2011-07-04 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/49619
PR rtl-optimization/49619
...
...
gcc/testsuite/g++.dg/diagnostic/aka1.C
0 → 100644
View file @
0d3128d6
// Basic test for typedef stripping in diagnostics.
struct
A
{
void
f
();
};
void
A
::
f
()
{
// We don't want an aka for the injected-class-name.
A
a
=
0
;
// { dg-error "type .A. requested" }
}
typedef
A
B
;
// We do want an aka for a real typedef.
B
b
=
0
;
// { dg-error "B .aka A." }
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