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
441b624e
Commit
441b624e
authored
Sep 15, 2010
by
Jason Merrill
Committed by
Jason Merrill
Sep 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* decl2.c (grokbitfield): Diagnose non-integral width.
From-SVN: r164321
parent
02a39a93
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
gcc/cp/ChangeLog
+2
-0
gcc/cp/decl2.c
+4
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/cpp0x/scoped_enum2.C
+11
-0
No files found.
gcc/cp/ChangeLog
View file @
441b624e
2010-09-15 Jason Merrill <jason@redhat.com>
* decl2.c (grokbitfield): Diagnose non-integral width.
* call.c (convert_like_real): Use the underlying type of the
reference for the temporary.
...
...
gcc/cp/decl2.c
View file @
441b624e
...
...
@@ -1066,6 +1066,10 @@ grokbitfield (const cp_declarator *declarator,
if
(
width
!=
error_mark_node
)
{
/* The width must be an integer type. */
if
(
!
INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P
(
TREE_TYPE
(
width
)))
error
(
"width of bit-field %qD has non-integral type %qT"
,
value
,
TREE_TYPE
(
width
));
constant_expression_warning
(
width
);
DECL_INITIAL
(
value
)
=
width
;
SET_DECL_C_BIT_FIELD
(
value
);
...
...
gcc/testsuite/ChangeLog
View file @
441b624e
2010-09-15 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/scoped_enum2.C: New.
2010-09-15 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/compile/20100915-1.c: New test.
...
...
gcc/testsuite/g++.dg/cpp0x/scoped_enum2.C
0 → 100644
View file @
441b624e
// { dg-options -std=c++0x }
enum
class
E
{
e
=
10
};
enum
E2
{
e2
=
10
};
struct
C
{
int
arr
[
E
::
e
];
// { dg-error "non-integral type" }
int
arr2
[
E2
::
e2
];
// OK
int
i
:
E
::
e
;
// { dg-error "non-integral type" }
int
i2
:
E2
::
e2
;
// OK
};
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