mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
fix issue 23122 - enum member UDAs semantics are not checked properly
This commit is contained in:
parent
20f3411172
commit
83b781c7bf
2 changed files with 12 additions and 6 deletions
|
@ -2310,6 +2310,7 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
|
|||
auto inneruda = em.userAttribDecl.userAttribDecl;
|
||||
em.userAttribDecl.setScope(sc);
|
||||
em.userAttribDecl.userAttribDecl = inneruda;
|
||||
em.userAttribDecl.dsymbolSemantic(sc);
|
||||
}
|
||||
|
||||
// The first enum member is special
|
||||
|
|
|
@ -3,14 +3,17 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/failattr.d(16): Error: variable `failattr.C2901.v1` cannot be `synchronized`
|
||||
fail_compilation/failattr.d(17): Error: variable `failattr.C2901.v2` cannot be `override`
|
||||
fail_compilation/failattr.d(18): Error: variable `failattr.C2901.v3` cannot be `abstract`
|
||||
fail_compilation/failattr.d(19): Error: variable `failattr.C2901.v4` cannot be `final`, perhaps you meant `const`?
|
||||
fail_compilation/failattr.d(31): Error: variable `failattr.C2901.v13` cannot be `final abstract synchronized override`
|
||||
fail_compilation/failattr.d(33): Error: variable `failattr.C2901.v14` cannot be `final`, perhaps you meant `const`?
|
||||
fail_compilation/failattr.d(103): Error: variable `failattr.C2901.v1` cannot be `synchronized`
|
||||
fail_compilation/failattr.d(104): Error: variable `failattr.C2901.v2` cannot be `override`
|
||||
fail_compilation/failattr.d(105): Error: variable `failattr.C2901.v3` cannot be `abstract`
|
||||
fail_compilation/failattr.d(106): Error: variable `failattr.C2901.v4` cannot be `final`, perhaps you meant `const`?
|
||||
fail_compilation/failattr.d(118): Error: variable `failattr.C2901.v13` cannot be `final abstract synchronized override`
|
||||
fail_compilation/failattr.d(120): Error: variable `failattr.C2901.v14` cannot be `final`, perhaps you meant `const`?
|
||||
fail_compilation/failattr.d(123): Error: undefined identifier `ERROR`
|
||||
---
|
||||
*/
|
||||
#line 100
|
||||
|
||||
class C2901
|
||||
{
|
||||
synchronized int v1; // error
|
||||
|
@ -32,3 +35,5 @@ class C2901
|
|||
|
||||
static final int v14; // error, even if static is applied at the same time
|
||||
}
|
||||
|
||||
enum B23122 { @ERROR e }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue