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
b4cf2e42
Commit
b4cf2e42
authored
Jun 15, 2018
by
Jason Merrill
Committed by
Jason Merrill
Jun 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* decl.c (start_enum): Do compare dependent underlying type.
From-SVN: r261655
parent
582f844c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
23 deletions
+13
-23
gcc/cp/ChangeLog
+2
-0
gcc/cp/decl.c
+3
-10
gcc/cp/name-lookup.h
+1
-1
gcc/testsuite/g++.dg/cpp0x/forw_enum10.C
+4
-4
gcc/testsuite/g++.dg/cpp0x/forw_enum7.C
+0
-2
gcc/testsuite/g++.dg/cpp0x/forw_enum8.C
+3
-6
No files found.
gcc/cp/ChangeLog
View file @
b4cf2e42
2018-06-15 Jason Merrill <jason@redhat.com>
* decl.c (start_enum): Do compare dependent underlying type.
PR c++/82882 - ICE with lambda in template default argument.
* lambda.c (record_null_lambda_scope): New.
* pt.c (tsubst_lambda_expr): Use it.
...
...
gcc/cp/decl.c
View file @
b4cf2e42
...
...
@@ -14131,8 +14131,6 @@ start_enum (tree name, tree enumtype, tree underlying_type,
enumtype
=
error_mark_node
;
}
else
if
(
underlying_type
&&
ENUM_UNDERLYING_TYPE
(
enumtype
)
&&
!
dependent_type_p
(
underlying_type
)
&&
!
dependent_type_p
(
ENUM_UNDERLYING_TYPE
(
enumtype
))
&&
!
same_type_p
(
underlying_type
,
ENUM_UNDERLYING_TYPE
(
enumtype
)))
{
...
...
@@ -14157,7 +14155,7 @@ start_enum (tree name, tree enumtype, tree underlying_type,
/* enumtype may be an ENUMERAL_TYPE if this is a redefinition
of an opaque enum, or an opaque enum of an already defined
enumeration (C++
0x only
).
enumeration (C++
11
).
In any other case, it'll be NULL_TREE. */
if
(
!
enumtype
)
{
...
...
@@ -14166,14 +14164,9 @@ start_enum (tree name, tree enumtype, tree underlying_type,
}
prevtype
=
enumtype
;
/* Do not push the decl more than once, unless we need to
compare underlying types at instantiation time */
/* Do not push the decl more than once. */
if
(
!
enumtype
||
TREE_CODE
(
enumtype
)
!=
ENUMERAL_TYPE
||
(
underlying_type
&&
dependent_type_p
(
underlying_type
))
||
(
ENUM_UNDERLYING_TYPE
(
enumtype
)
&&
dependent_type_p
(
ENUM_UNDERLYING_TYPE
(
enumtype
))))
||
TREE_CODE
(
enumtype
)
!=
ENUMERAL_TYPE
)
{
enumtype
=
cxx_make_type
(
ENUMERAL_TYPE
);
enumtype
=
pushtag
(
name
,
enumtype
,
/*tag_scope=*/
ts_current
);
...
...
gcc/cp/name-lookup.h
View file @
b4cf2e42
...
...
@@ -112,7 +112,7 @@ enum scope_kind {
of an if or switch statement. */
sk_function_parms
,
/* The scope containing function parameters. */
sk_class
,
/* The scope containing the members of a class. */
sk_scoped_enum
,
/* The scope containing the enumer
tors of a C++0x
sk_scoped_enum
,
/* The scope containing the enumer
ators of a C++11
scoped enumeration. */
sk_namespace
,
/* The scope containing the members of a
namespace, including the global scope. */
...
...
gcc/testsuite/g++.dg/cpp0x/forw_enum10.C
View file @
b4cf2e42
...
...
@@ -6,7 +6,7 @@ template<typename T> struct S1
enum
E
:
T
;
// { dg-message "previous definition" }
enum
E
:
int
;
// { dg-error "different underlying type" }
};
template
struct
S1
<
short
>
;
// { dg-message "required from here" }
template
struct
S1
<
short
>
;
template
<
typename
T
>
struct
S2
{
...
...
@@ -17,8 +17,8 @@ template struct S2<short>;
template
<
typename
T1
,
typename
T2
>
struct
S3
{
enum
E
:
T1
;
enum
E
:
T2
;
enum
E
:
T1
;
// { dg-message "previous definition" }
enum
E
:
T2
;
// { dg-error "different underlying type" }
};
template
struct
S3
<
short
,
short
>
;
...
...
@@ -27,4 +27,4 @@ template<typename T1, typename T2> struct S4
enum
E
:
T1
;
// { dg-message "previous definition" }
enum
E
:
T2
;
// { dg-error "different underlying type" }
};
template
struct
S4
<
short
,
char
>
;
// { dg-message "required from here" }
template
struct
S4
<
short
,
char
>
;
gcc/testsuite/g++.dg/cpp0x/forw_enum7.C
View file @
b4cf2e42
...
...
@@ -4,8 +4,6 @@
template
<
typename
T
>
struct
S1
{
enum
E1
:
int
;
enum
E1
:
T
;
enum
class
E2
:
int
;
enum
class
E2
:
T
;
};
...
...
gcc/testsuite/g++.dg/cpp0x/forw_enum8.C
View file @
b4cf2e42
// { dg-do compile { target c++11 } }
//This instatiation is ok
template
<
typename
T
>
struct
S1
{
enum
E
:
int
;
enum
E
:
T
;
enum
E
:
int
;
// { dg-message "previous definition" }
enum
E
:
T
;
// { dg-error "different underlying type" }
};
template
struct
S1
<
int
>
;
//ok
//This error is diagnosed at instantiation time
template
<
typename
T
>
struct
S2
{
enum
E
:
int
;
// { dg-message "previous definition" }
enum
E
:
T
;
// { dg-error "different underlying type" }
};
template
struct
S2
<
short
>
;
// { dg-message "required from here" }
template
struct
S2
<
short
>
;
//This error is diagnosed at compilation time
template
<
typename
T
>
struct
S3
{
enum
E
:
int
;
// { dg-message "previous definition" }
...
...
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