Changeset b1f2007 for src/Virtual


Ignore:
Timestamp:
Dec 13, 2023, 9:17:13 AM (5 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
4c2fe47
Parents:
c40157e
Message:

first attempt at simplifying SemanticError? and its usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Virtual/ExpandCasts.cc

    rc40157e rb1f2007  
    99// Author           : Andrew Beach
    1010// Created On       : Mon Jul 24 13:59:00 2017
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Aug 11 12:06:00 2022
    13 // Update Count     : 5
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Nov 27 09:28:20 2023
     13// Update Count     : 10
    1414//
    1515
     
    160160
    161161        // Helper function for throwing semantic errors.
    162         auto throwError = [&fieldName, &errorLocation, &oldDecl](
    163                         std::string const & message ) {
    164                 std::string const & context = "While following head pointer of " +
    165                         oldDecl->name + " named '" + fieldName + "': ";
    166                 SemanticError( errorLocation, context + message );
     162        auto throwError = [&fieldName, &errorLocation, &oldDecl]( std::string const & message ) {
     163                SemanticError( errorLocation, "While following head pointer of %s named \"%s\": %s",
     164                                           oldDecl->name.c_str(), fieldName.c_str(), message.c_str() );
    167165        };
    168166
Note: See TracChangeset for help on using the changeset viewer.