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
af4e7bac
Commit
af4e7bac
authored
Apr 11, 2002
by
Richard Sandiford
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert previous patch.
From-SVN: r52166
parent
94ed0002
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
65 deletions
+3
-65
gcc/cp/ChangeLog
+0
-6
gcc/cp/decl.c
+3
-28
gcc/testsuite/ChangeLog
+0
-4
gcc/testsuite/g++.dg/ext/attrib5.C
+0
-27
No files found.
gcc/cp/ChangeLog
View file @
af4e7bac
2002-04-11 Richard Sandiford <rsandifo@redhat.com>
* decl.c (duplicate_decls): Don't try to unify an implicit typedef
with an explicit one.
(lookup_tag): Extract the tag of an explicit typedef.
2002-04-10 Nathan Sidwell <nathan@codesourcery.com>
2002-04-10 Nathan Sidwell <nathan@codesourcery.com>
PR c++/5507
PR c++/5507
...
...
gcc/cp/decl.c
View file @
af4e7bac
...
@@ -3426,18 +3426,6 @@ duplicate_decls (newdecl, olddecl)
...
@@ -3426,18 +3426,6 @@ duplicate_decls (newdecl, olddecl)
}
}
}
}
/* Do not merge an implicit typedef with an explicit one. In:
class A;
...
typedef class A A __attribute__ ((foo));
the attribute should apply only to the typedef. */
if
(
TREE_CODE
(
olddecl
)
==
TYPE_DECL
&&
(
DECL_IMPLICIT_TYPEDEF_P
(
olddecl
)
||
DECL_IMPLICIT_TYPEDEF_P
(
newdecl
)))
return
0
;
/* If new decl is `static' and an `extern' was seen previously,
/* If new decl is `static' and an `extern' was seen previously,
warn about it. */
warn about it. */
warn_extern_redeclared_static
(
newdecl
,
olddecl
);
warn_extern_redeclared_static
(
newdecl
,
olddecl
);
...
@@ -5348,23 +5336,10 @@ lookup_tag (form, name, binding_level, thislevel_only)
...
@@ -5348,23 +5336,10 @@ lookup_tag (form, name, binding_level, thislevel_only)
else
else
old
=
BINDING_TYPE
(
old
);
old
=
BINDING_TYPE
(
old
);
/* If the declaration has an original type, it must a
/* If it has an original type, it is a typedef, and we
typedef. When it is an explicit typedef of the form:
should not return it. */
typedef struct A A;
the original type will be the tag that we want.
We should not return any other kind of typedef.
Detect the valid case by checking that the original
type has the same name and context as the typedef. */
if
(
old
&&
DECL_ORIGINAL_TYPE
(
TYPE_NAME
(
old
)))
if
(
old
&&
DECL_ORIGINAL_TYPE
(
TYPE_NAME
(
old
)))
{
old
=
NULL_TREE
;
old
=
DECL_ORIGINAL_TYPE
(
TYPE_NAME
(
old
));
if
(
TYPE_IDENTIFIER
(
old
)
!=
name
||
context_for_name_lookup
(
TYPE_NAME
(
old
))
!=
tail
)
old
=
NULL_TREE
;
}
if
(
old
&&
TREE_CODE
(
old
)
!=
form
if
(
old
&&
TREE_CODE
(
old
)
!=
form
&&
(
form
==
ENUMERAL_TYPE
||
TREE_CODE
(
old
)
==
ENUMERAL_TYPE
))
&&
(
form
==
ENUMERAL_TYPE
||
TREE_CODE
(
old
)
==
ENUMERAL_TYPE
))
{
{
...
...
gcc/testsuite/ChangeLog
View file @
af4e7bac
2002-04-11 Richard Sandiford <rsandifo@redhat.com>
* g++.dg/ext/attrib5.C: New test.
2002-04-10 Janis Johnson <janis187@us.ibm.com>
2002-04-10 Janis Johnson <janis187@us.ibm.com>
* g77.f-torture/execute/6177.f: New test.
* g77.f-torture/execute/6177.f: New test.
...
...
gcc/testsuite/g++.dg/ext/attrib5.C
deleted
100644 → 0
View file @
94ed0002
// There were two related problems here, depending on the vintage. At
// one time:
//
// typedef struct A { ... } A __attribute__ ((aligned (16)));
//
// would cause original_types to go into an infinite loop. At other
// times, the attributes applied to an explicit typedef would be lost
// (check_b2 would have a negative size).
// First check that the declaration is accepted and has an effect.
typedef
struct
A
{
int
i
;
}
A
__attribute__
((
aligned
(
16
)));
int
check_A
[
__alignof__
(
A
)
>=
16
?
1
:
-
1
];
// Check that the alignment is only applied to the typedef.
struct
B
{
int
i
;
};
namespace
N
{
typedef
B
B
;
};
typedef
struct
B
B
__attribute__
((
aligned
(
16
)));
N
::
B
b1
;
B
b2
;
int
check_b1
[
__alignof__
(
b1
)
==
__alignof__
(
int
)
?
1
:
-
1
];
int
check_b2
[
__alignof__
(
b2
)
>=
16
?
1
:
-
1
];
// The fix for this case involved a change to lookup_tag. This
// bit just checks against a possible regression.
namespace
N
{
struct
C
;
};
typedef
struct
N
::
C
C
;
// { dg-error "previous declaration" }
struct
C
;
// { dg-error "conflicting types" }
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