re PR c++/66243 (enum class value is allowed to be initialized by value from other enum class)
cp/ PR c++/66243 * decl.c (build_enumerator): Don't silently convert scoped enums. testsuite/ PR c++/66243 * g++.dg/cpp0x/pr66243.C: New. From-SVN: r223636
This commit is contained in:
parent
bce0e38df9
commit
6f2d72e0e1
4 changed files with 26 additions and 3 deletions
|
@ -1,4 +1,9 @@
|
|||
2015-05-22 Jan Hubicka <hubicka@ucw.cz>
|
||||
2015-05-24 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/66243
|
||||
* decl.c (build_enumerator): Don't silently convert scoped enums.
|
||||
|
||||
2015-05-24 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR lto/66180
|
||||
* mangle.c (mangle_decl): Mangle anonymous namespace types as
|
||||
|
|
|
@ -13097,7 +13097,8 @@ build_enumerator (tree name, tree value, tree enumtype, tree attributes,
|
|||
if (tmp_value)
|
||||
value = tmp_value;
|
||||
}
|
||||
else if (! INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value)))
|
||||
else if (! INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P
|
||||
(TREE_TYPE (value)))
|
||||
value = perform_implicit_conversion_flags
|
||||
(ENUM_UNDERLYING_TYPE (enumtype), value, tf_warning_or_error,
|
||||
LOOKUP_IMPLICIT | LOOKUP_NO_NARROWING);
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
2015-05-22 Jan Hubicka <hubicka@ucw.cz>
|
||||
2015-05-23 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/66243
|
||||
* g++.dg/cpp0x/pr66243.C: New.
|
||||
|
||||
2015-05-24 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR lto/66180
|
||||
* g++.dg/lto/pr66180_0.C: New testcase.
|
||||
|
|
12
gcc/testsuite/g++.dg/cpp0x/pr66243.C
Normal file
12
gcc/testsuite/g++.dg/cpp0x/pr66243.C
Normal file
|
@ -0,0 +1,12 @@
|
|||
// { dg-do compile { target c++11 } }
|
||||
|
||||
enum class A
|
||||
{
|
||||
X
|
||||
};
|
||||
|
||||
enum class B
|
||||
{
|
||||
X = A::X // { dg-error "could not convert" }
|
||||
};
|
||||
|
Loading…
Add table
Reference in a new issue