Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/EnumAndPointerDecay.cpp

    re9e9f56 r11df881  
    1010// Created On       : Tue Jun 28 15:50:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Sep 20 16:14:00 2022
    13 // Update Count     : 1
     12// Last Modified On : Tue Jul 12 14:45:00 2022
     13// Update Count     : 0
    1414//
    1515
     
    2626namespace {
    2727
    28 struct EnumAndPointerDecayCore final : public ast::WithCodeLocation {
     28struct EnumAndPointerDecayCore final : public ast::WithGuards {
     29        CodeLocation const * location = nullptr;
     30        void previsit( ast::ParseNode const * node );
    2931        ast::EnumDecl const * previsit( ast::EnumDecl const * decl );
    3032        ast::FunctionDecl const * previsit( ast::FunctionDecl const * decl );
    3133        ast::FunctionType const * previsit( ast::FunctionType const * type );
    3234};
     35
     36void EnumAndPointerDecayCore::previsit( ast::ParseNode const * node ) {
     37        GuardValue( location ) = &node->location;
     38}
    3339
    3440ast::EnumDecl const * EnumAndPointerDecayCore::previsit(
     
    4450                        new ast::EnumInstType( decl, ast::CV::Const ) );
    4551        }
     52        GuardValue( location ) = &decl->location;
    4653        return mut;
    4754}
     
    7279                ast::FunctionDecl const * decl ) {
    7380        auto mut = ast::mutate( decl );
     81        GuardValue( location ) = &decl->location;
    7482        ast::ArgumentFlag isVarArgs = mut->type->isVarArgs;
    7583        // It seems fixFunction (via fixFunctionList) does the pointer decay part.
Note: See TracChangeset for help on using the changeset viewer.