Ignore:
Timestamp:
Aug 29, 2024, 2:38:39 PM (14 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
9bb6c5f
Parents:
960665c (diff), b965774 (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/Parser/DeclarationNode.cpp

    r960665c rad47ec4  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb 23 18:25:57 2024
    13 // Update Count     : 1533
     12// Last Modified On : Thu Aug 22 14:11:47 2024
     13// Update Count     : 1555
    1414//
    1515
     
    134134                os << endl << string( indent + 2, ' ' ) << "with initializer ";
    135135                initializer->printOneLine( os );
    136                 os << " maybe constructed? " << initializer->get_maybeConstructed();
     136                if ( ! initializer->get_maybeConstructed() ) {
     137                        os << " constructed with @= ";
     138                } // if
    137139        } // if
    138140
     
    957959                        isDelete ? nullptr : maybeBuild( initializer ),
    958960                        copy( attributes )
    959                 )->set_extension( extension );
     961                );
     962                decl->extension = extension;
    960963                if ( isDelete ) {
    961964                        auto dwt = strict_dynamic_cast<ast::DeclWithType *>( decl );
     
    9991002        assert( type );
    10001003
    1001         // Some types are parsed as declarations and, syntactically, can have
    1002         // initializers. However, semantically, this is meaningless.
    1003         if ( initializer ) {
    1004                 SemanticError( this, "Initializer on type declaration " );
     1004        // Some types are parsed as declarations and, syntactically, can have initializers, which are not support (possibly
     1005        // meaningless).
     1006        if ( initializer && initializer->get_maybeConstructed() ) { // no @=
     1007                SemanticError( location, "default initialization for parameter %s is unsupport for a function-pointer declaration.",
     1008                                           (this->name) ? this->name->c_str() : "anonymous" );
    10051009        }
    10061010
Note: See TracChangeset for help on using the changeset viewer.