Changeset 5546eee4 for src/AST/Decl.cpp


Ignore:
Timestamp:
Dec 16, 2023, 1:01:44 AM (22 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
b7898ac
Parents:
0fa0201d (diff), 69ab896 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.cpp

    r0fa0201d r5546eee4  
    99// Author           : Aaron B. Moss
    1010// Created On       : Thu May 9 10:00:00 2019
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thu May  5 12:10:00 2022
    13 // Update Count     : 24
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat Dec  9 16:28:51 2023
     13// Update Count     : 31
    1414//
    1515
     
    113113// --- EnumDecl
    114114
    115 bool EnumDecl::valueOf( const Decl * enumerator, long long& value ) const {
     115bool EnumDecl::valueOf( const Decl * enumerator, long long & value ) const {
    116116        if ( enumValues.empty() ) {
    117117                Evaluation crntVal = {0, true, true};  // until expression is given, we know to start counting from 0
    118118                for ( const Decl * member : members ) {
    119                         const ObjectDecl* field = strict_dynamic_cast< const ObjectDecl* >( member );
     119                        const ObjectDecl * field = strict_dynamic_cast< const ObjectDecl * >( member );
    120120                        if ( field->init ) {
    121                                 const SingleInit * init = strict_dynamic_cast< const SingleInit* >( field->init.get() );
     121                                const SingleInit * init = strict_dynamic_cast< const SingleInit * >( field->init.get() );
    122122                                crntVal = eval( init->value );
    123123                                if ( ! crntVal.isEvaluableInGCC ) {
    124                                         SemanticError( init->location, ::toString( "Non-constexpr in initialization of "
    125                                                 "enumerator: ", field ) );
     124                                        SemanticError( init->location, "Non-constexpr in initialization of enumerator %s", field->name.c_str() );
    126125                                }
    127126                        }
    128127                        if ( enumValues.count( field->name ) != 0 ) {
    129                                 SemanticError( location, ::toString( "Enum ", name, " has multiple members with the "   "name ", field->name ) );
     128                                SemanticError( location, "Enum %s has multiple members with %s", name.c_str(), field->name.c_str() );
    130129                        }
    131130                        if (crntVal.hasKnownValue) {
Note: See TracChangeset for help on using the changeset viewer.