Changeset 4c2fe47
- Timestamp:
- Dec 13, 2023, 9:18:36 AM (12 months ago)
- Branches:
- master
- Children:
- b83c575
- Parents:
- b1f2007
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
rb1f2007 r4c2fe47 9 9 // Author : Aaron B. Moss 10 10 // Created On : Thu May 9 10:00:00 2019 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thu May 5 12:10:00 202213 // Update Count : 2411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Dec 9 16:28:51 2023 13 // Update Count : 31 14 14 // 15 15 … … 113 113 // --- EnumDecl 114 114 115 bool EnumDecl::valueOf( const Decl * enumerator, long long & value ) const {115 bool EnumDecl::valueOf( const Decl * enumerator, long long & value ) const { 116 116 if ( enumValues.empty() ) { 117 117 Evaluation crntVal = {0, true, true}; // until expression is given, we know to start counting from 0 118 118 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 ); 120 120 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() ); 122 122 crntVal = eval( init->value ); 123 123 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() ); 126 125 } 127 126 } 128 127 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() ); 130 129 } 131 130 if (crntVal.hasKnownValue) { -
src/ResolvExpr/Resolver.cc
rb1f2007 r4c2fe47 9 9 // Author : Aaron B. Moss 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Apr 20 10:41:00 202213 // Update Count : 24 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Dec 9 17:45:57 2023 13 // Update Count : 249 14 14 // 15 15 … … 958 958 ++n_mutex_param; 959 959 960 // Check if the argument matches the parameter type in the current 961 // scope 960 // Check if the argument matches the parameter type in the current scope. 962 961 // ast::ptr< ast::Type > paramType = (*param)->get_type(); 962 963 963 if ( 964 964 ! unify(
Note: See TracChangeset
for help on using the changeset viewer.