Ignore:
Timestamp:
Jul 19, 2018, 6:16:41 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
68bceeb
Parents:
679a260
Message:

fix extend plan 9, anonymous declarations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r679a260 re07caa2  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 18 22:50:27 2018
    13 // Update Count     : 1096
     12// Last Modified On : Thu Jul 19 17:40:03 2018
     13// Update Count     : 1106
    1414//
    1515
     
    5454
    5555DeclarationNode::DeclarationNode() :
    56                 builtin( NoBuiltinType ),
    57                 type( nullptr ),
    58                 inLine( false ),
    59                 bitfieldWidth( nullptr ),
    60                 hasEllipsis( false ),
    61                 linkage( ::linkage ),
    62                 asmName( nullptr ),
    63                 initializer( nullptr ),
    64                 extension( false ),
    65                 asmStmt( nullptr ) {
     56        linkage( ::linkage ) {
    6657
    6758//      variable.name = nullptr;
     
    1004995                                //   struct T;            // anonymous member
    1005996                                // };
    1006                                 if ( ! (extracted && decl->name == "" && ! anon) ) {
    1007                                         if (decl->name == "") {
     997                                if ( ! (extracted && decl->name == "" && ! anon && ! cur->get_inLine()) ) {
     998                                        if ( decl->name == "" ) {
    1008999                                                if ( DeclarationWithType * dwt = dynamic_cast<DeclarationWithType *>( decl ) ) {
    10091000                                                        if ( ReferenceToType * aggr = dynamic_cast<ReferenceToType *>( dwt->get_type() ) ) {
    10101001                                                                if ( aggr->name.find("anonymous") == std::string::npos ) {
    1011                                                                         if ( ! cur->inLine ) {
    1012                                                                                 // temporary: warn about anonymous member declarations of named types, since this conflicts with the syntax for the forward declaration of an anonymous type
     1002                                                                        if ( ! cur->get_inLine() ) {
     1003                                                                                // temporary: warn about anonymous member declarations of named types, since
     1004                                                                                // this conflicts with the syntax for the forward declaration of an anonymous type
    10131005                                                                                SemanticWarning( cur->location, Warning::AggrForwardDecl, aggr->name.c_str() );
    1014                                                                         }
    1015                                                                 }
    1016                                                         }
    1017                                                 }
    1018                                         }
     1006                                                                        } // if
     1007                                                                } // if
     1008                                                        } // if
     1009                                                } // if
     1010                                        } // if
    10191011                                        decl->location = cur->location;
    1020                                         * out++ = decl;
    1021                                 }
     1012                                        *out++ = decl;
     1013                                } // if
    10221014                        } // if
    10231015                } catch( SemanticErrorException &e ) {
    10241016                        errors.append( e );
    10251017                } // try
    1026         } // while
     1018        } // for
    10271019
    10281020        if ( ! errors.isEmpty() ) {
Note: See TracChangeset for help on using the changeset viewer.