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
640c2adf
Commit
640c2adf
authored
Jun 06, 2010
by
Fabien Chêne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PR c++/44086
From-SVN: r160337
parent
389caea8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
8 deletions
+37
-8
gcc/cp/ChangeLog
+7
-0
gcc/cp/class.c
+8
-8
gcc/testsuite/ChangeLog
+6
-0
gcc/testsuite/g++.dg/cpp0x/decltype4.C
+1
-0
gcc/testsuite/g++.dg/init/pr44086.C
+15
-0
No files found.
gcc/cp/ChangeLog
View file @
640c2adf
2010-06-05 Fabien Chne <fabien@gcc.gnu.org>
PR c++/44086
* class.c (check_field_decls): Move the call to
check_bitfield_decl before trying to set the
CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
* typeck.c: Update include path for moved files.
...
...
gcc/cp/class.c
View file @
640c2adf
...
...
@@ -3092,6 +3092,14 @@ check_field_decls (tree t, tree *access_decls,
if
(
!
zero_init_p
(
type
))
CLASSTYPE_NON_ZERO_INIT_P
(
t
)
=
1
;
/* We set DECL_C_BIT_FIELD in grokbitfield.
If the type and width are valid, we'll also set DECL_BIT_FIELD. */
if
(
!
DECL_C_BIT_FIELD
(
x
)
||
!
check_bitfield_decl
(
x
))
check_field_decl
(
x
,
t
,
cant_have_const_ctor_p
,
no_const_asn_ref_p
,
&
any_default_members
);
/* If any field is const, the structure type is pseudo-const. */
if
(
CP_TYPE_CONST_P
(
type
))
{
...
...
@@ -3120,14 +3128,6 @@ check_field_decls (tree t, tree *access_decls,
if
(
constructor_name_p
(
DECL_NAME
(
x
),
t
)
&&
TYPE_HAS_USER_CONSTRUCTOR
(
t
))
permerror
(
input_location
,
"field %q+#D with same name as class"
,
x
);
/* We set DECL_C_BIT_FIELD in grokbitfield.
If the type and width are valid, we'll also set DECL_BIT_FIELD. */
if
(
!
DECL_C_BIT_FIELD
(
x
)
||
!
check_bitfield_decl
(
x
))
check_field_decl
(
x
,
t
,
cant_have_const_ctor_p
,
no_const_asn_ref_p
,
&
any_default_members
);
}
/* Effective C++ rule 11: if a class has dynamic memory held by pointers,
...
...
gcc/testsuite/ChangeLog
View file @
640c2adf
2010-06-05 Fabien Chne <fabien@gcc.gnu.org>
PR c++/44086
* g++.dg/init/pr44086.C: New.
* g++.dg/cpp0x/decltype4.C: Adjust.
2010-06-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/43945
...
...
gcc/testsuite/g++.dg/cpp0x/decltype4.C
View file @
640c2adf
...
...
@@ -62,6 +62,7 @@ void wibble() {
}
struct
B
{
B
()
:
bit
(),
cbit
()
{}
int
bit
:
2
;
const
int
cbit
:
3
;
...
...
gcc/testsuite/g++.dg/init/pr44086.C
0 → 100644
View file @
640c2adf
// PR c++/44086
// { dg-do compile }
struct
A
{
int
const
i
:
2
;
// { dg-message "should be initialized" }
};
void
f
()
{
A
a
;
// { dg-error "uninitialized const" }
new
A
;
// { dg-error "uninitialized const" }
A
();
new
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