Changeset 5ccc733 for src/Parser


Ignore:
Timestamp:
Jun 29, 2024, 5:02:06 AM (3 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
4117761
Parents:
7552fde
Message:

Fix the bug that C style enum cannot to use as an lvalue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cpp

    r7552fde r5ccc733  
    14691469                ast::ObjectDecl * object = strict_dynamic_cast<ast::ObjectDecl *>( member );
    14701470                object->isHidden = ast::EnumDecl::EnumHiding::Hide == ret->hide;
    1471                 if ( ret->isTyped && !ret->base && cur->has_enumeratorValue() ) {
    1472                         SemanticError( td->location, "Enumerator of enum(void) cannot have an explicit initializer value." );
     1471                if ( ret->isOpague() && cur->has_enumeratorValue() ) {
     1472                        SemanticError( td->location, "Opague cannot have an explicit initializer value." );
    14731473                } else if ( cur->has_enumeratorValue() ) {
    14741474                        object->init = new ast::SingleInit(
Note: See TracChangeset for help on using the changeset viewer.