Changes in / [381bea6:2a9d12d]
- Files:
-
- 10 edited
-
libcfa/prelude/builtins.c (modified) (1 diff)
-
src/ControlStruct/ExceptTranslate.cc (modified) (1 diff)
-
src/InitTweak/FixInit.cc (modified) (13 diffs)
-
src/InitTweak/InitTweak.cc (modified) (1 diff)
-
src/SymTab/Autogen.cc (modified) (5 diffs)
-
src/SymTab/Autogen.h (modified) (1 diff)
-
src/SynTree/DeclReplacer.cc (modified) (3 diffs)
-
src/SynTree/DeclReplacer.h (modified) (1 diff)
-
tests/raii/.expect/memberCtors.txt (modified) (3 diffs)
-
tests/raii/memberCtors.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/builtins.c
r381bea6 r2a9d12d 111 111 static inline unsigned int ?\=?( unsigned int & x, unsigned long int y ) { x = x \ y; return x; } 112 112 113 // type that wraps a pointer and a destructor-like function - used in generating implicit destructor calls for struct members in user-defined functions114 forall(dtype T)115 struct __Destructor {116 T * object;117 void (*dtor)(T *);118 };119 120 // defined destructor in the case that non-generated code wants to use __Destructor121 forall(dtype T)122 static inline void ^?{}(__Destructor(T) & x) {123 if (x.object && x.dtor) {124 x.dtor(x.object);125 }126 }127 128 // easy interface into __Destructor's destructor for easy codegen purposes129 extern "C" {130 forall(dtype T)131 static inline void __destroy_Destructor(__Destructor(T) * dtor) {132 ^(*dtor){};133 }134 }135 136 113 // Local Variables: // 137 114 // mode: c // -
src/ControlStruct/ExceptTranslate.cc
r381bea6 r2a9d12d 319 319 } 320 320 321 block->push_back( handler-> body);322 handler-> body = nullptr;321 block->push_back( handler->get_body() ); 322 handler->set_body( nullptr ); 323 323 324 324 std::list<Statement *> caseBody -
src/InitTweak/FixInit.cc
r381bea6 r2a9d12d 54 54 #include "SynTree/Type.h" // for Type, Type::StorageClasses 55 55 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution, operator<< 56 #include "SynTree/DeclReplacer.h" // for DeclReplacer57 56 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 58 57 … … 163 162 using Parent::previsit; 164 163 164 void previsit( ObjectDecl * objDecl ); 165 165 void previsit( FunctionDecl * funcDecl ); 166 166 167 void previsit( CompoundStmt * compoundStmt ); 168 void postvisit( CompoundStmt * compoundStmt ); 169 void previsit( ReturnStmt * returnStmt ); 167 170 void previsit( BranchStmt * stmt ); 168 171 private: … … 204 207 static void generate( std::list< Declaration * > & translationUnit ); 205 208 206 void premutate( StructDecl * structDecl );207 208 209 void premutate( FunctionDecl * funcDecl ); 209 210 DeclarationWithType * postmutate( FunctionDecl * funcDecl ); … … 227 228 bool isCtor = false; // true if current function is a constructor 228 229 StructDecl * structDecl = nullptr; 229 230 // special built-in functions necessary for this to work231 StructDecl * dtorStruct = nullptr;232 FunctionDecl * dtorStructDestroy = nullptr;233 230 }; 234 231 … … 735 732 } 736 733 737 DeclarationWithType * getDtorFunc( ObjectDecl * objDecl, Statement * input, std::list< Statement * > & stmtsToAdd ) {738 // unwrap implicit statement wrapper739 Statement * dtor = input;740 if ( ImplicitCtorDtorStmt * implicit = dynamic_cast< ImplicitCtorDtorStmt * >( input ) ) {741 // dtor = implicit->callStmt;742 // implicit->callStmt = nullptr;743 }744 assert( dtor );745 std::list< Expression * > matches;746 collectCtorDtorCalls( dtor, matches );747 748 if ( dynamic_cast< ExprStmt * >( dtor ) ) {749 // only one destructor call in the expression750 if ( matches.size() == 1 ) {751 DeclarationWithType * func = getFunction( matches.front() );752 assertf( func, "getFunction failed to find function in %s", toString( matches.front() ).c_str() );753 754 // cleanup argument must be a function, not an object (including function pointer)755 if ( FunctionDecl * dtorFunc = dynamic_cast< FunctionDecl * > ( func ) ) {756 if ( dtorFunc->type->forall.empty() ) {757 // simple case where the destructor is a monomorphic function call - can simply758 // use that function as the cleanup function.759 delete dtor;760 return func;761 }762 }763 }764 }765 766 // otherwise the cleanup is more complicated - need to build a single argument cleanup function that767 // wraps the more complicated code.768 static UniqueName dtorNamer( "__cleanup_dtor" );769 FunctionDecl * dtorFunc = FunctionDecl::newFunction( dtorNamer.newName(), SymTab::genDefaultType( objDecl->type->stripReferences(), false ), new CompoundStmt() );770 stmtsToAdd.push_back( new DeclStmt( dtorFunc ) );771 772 // the original code contains uses of objDecl - replace them with the newly generated 'this' parameter.773 ObjectDecl * thisParam = getParamThis( dtorFunc->type );774 Expression * replacement = new VariableExpr( thisParam );775 776 Type * base = replacement->result->stripReferences();777 if ( dynamic_cast< ArrayType * >( base ) || dynamic_cast< TupleType * > ( base ) ) {778 // need to cast away reference for array types, since the destructor is generated without the reference type,779 // and for tuple types since tuple indexing does not work directly on a reference780 replacement = new CastExpr( replacement, base->clone() );781 }782 DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } );783 dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) );784 785 return dtorFunc;786 }787 788 734 DeclarationWithType * FixInit::postmutate( ObjectDecl *objDecl ) { 789 735 // since this removes the init field from objDecl, it must occur after children are mutated (i.e. postmutate) … … 898 844 ctorInit->ctor = nullptr; 899 845 } 900 901 Statement * dtor = ctorInit->dtor;902 if ( dtor ) {903 ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * >( dtor );904 Statement * dtorStmt = implicit->callStmt;905 906 // don't need to call intrinsic dtor, because it does nothing, but907 // non-intrinsic dtors must be called908 if ( ! isIntrinsicSingleArgCallStmt( dtorStmt ) ) {909 // set dtor location to the object's location for error messages910 DeclarationWithType * dtorFunc = getDtorFunc( objDecl, dtorStmt, stmtsToAddBefore );911 objDecl->attributes.push_back( new Attribute( "cleanup", { new VariableExpr( dtorFunc ) } ) );912 ctorInit->dtor = nullptr;913 } // if914 }915 846 } // if 916 847 } else if ( Initializer * init = ctorInit->init ) { … … 955 886 956 887 888 template<typename Iterator, typename OutputIterator> 889 void insertDtors( Iterator begin, Iterator end, OutputIterator out ) { 890 for ( Iterator it = begin ; it != end ; ++it ) { 891 // extract destructor statement from the object decl and insert it into the output. Note that this is 892 // only called on lists of non-static objects with implicit non-intrinsic dtors, so if the user manually 893 // calls an intrinsic dtor then the call must (and will) still be generated since the argument may 894 // contain side effects. 895 ObjectDecl * objDecl = *it; 896 ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ); 897 assert( ctorInit && ctorInit->get_dtor() ); 898 *out++ = ctorInit->get_dtor()->clone(); 899 } // for 900 } 901 902 void InsertDtors::previsit( ObjectDecl * objDecl ) { 903 // remember non-static destructed objects so that their destructors can be inserted later 904 if ( ! objDecl->get_storageClasses().is_static ) { 905 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { 906 // a decision should have been made by the resolver, so ctor and init are not both non-NULL 907 assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() ); 908 Statement * dtor = ctorInit->get_dtor(); 909 // don't need to call intrinsic dtor, because it does nothing, but 910 // non-intrinsic dtors must be called 911 if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) { 912 // set dtor location to the object's location for error messages 913 ctorInit->dtor->location = objDecl->location; 914 reverseDeclOrder.front().push_front( objDecl ); 915 } // if 916 } // if 917 } // if 918 } 919 957 920 void InsertDtors::previsit( FunctionDecl * funcDecl ) { 958 921 // each function needs to have its own set of labels … … 967 930 } 968 931 932 void InsertDtors::previsit( CompoundStmt * compoundStmt ) { 933 // visit statements - this will also populate reverseDeclOrder list. don't want to dump all destructors 934 // when block is left, just the destructors associated with variables defined in this block, so push a new 935 // list to the top of the stack so that we can differentiate scopes 936 reverseDeclOrder.push_front( OrderedDecls() ); 937 Parent::previsit( compoundStmt ); 938 } 939 940 void InsertDtors::postvisit( CompoundStmt * compoundStmt ) { 941 // add destructors for the current scope that we're exiting, unless the last statement is a return, which 942 // causes unreachable code warnings 943 std::list< Statement * > & statements = compoundStmt->get_kids(); 944 if ( ! statements.empty() && ! dynamic_cast< ReturnStmt * >( statements.back() ) ) { 945 insertDtors( reverseDeclOrder.front().begin(), reverseDeclOrder.front().end(), back_inserter( statements ) ); 946 } 947 reverseDeclOrder.pop_front(); 948 } 949 950 void InsertDtors::previsit( ReturnStmt * ) { 951 // return exits all scopes, so dump destructors for all scopes 952 for ( OrderedDecls & od : reverseDeclOrder ) { 953 insertDtors( od.begin(), od.end(), back_inserter( stmtsToAddBefore ) ); 954 } // for 955 } 956 969 957 // Handle break/continue/goto in the same manner as C++. Basic idea: any objects that are in scope at the 970 958 // BranchStmt but not at the labelled (target) statement must be destructed. If there are any objects in scope … … 994 982 if ( ! diff.empty() ) { 995 983 SemanticError( stmt, std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " " ); 984 } // if 985 // S_G-S_L results in set of objects that must be destructed 986 diff.clear(); 987 std::set_difference( curVars.begin(), curVars.end(), lvars.begin(), lvars.end(), std::inserter( diff, diff.end() ) ); 988 DTOR_PRINT( 989 std::cerr << "S_G-S_L = " << printSet( diff ) << std::endl; 990 ) 991 if ( ! diff.empty() ) { 992 // create an auxilliary set for fast lookup -- can't make diff a set, because diff ordering should be consistent for error messages. 993 std::unordered_set<ObjectDecl *> needsDestructor( diff.begin(), diff.end() ); 994 995 // go through decl ordered list of objectdecl. for each element that occurs in diff, output destructor 996 OrderedDecls ordered; 997 for ( OrderedDecls & rdo : reverseDeclOrder ) { 998 // add elements from reverseDeclOrder into ordered if they occur in diff - it is key that this happens in reverse declaration order. 999 copy_if( rdo.begin(), rdo.end(), back_inserter( ordered ), [&]( ObjectDecl * objDecl ) { return needsDestructor.count( objDecl ); } ); 1000 } // for 1001 insertDtors( ordered.begin(), ordered.end(), back_inserter( stmtsToAddBefore ) ); 996 1002 } // if 997 1003 } … … 1019 1025 } 1020 1026 1021 void GenStructMemberCalls::premutate( StructDecl * structDecl ) {1022 if ( ! dtorStruct && structDecl->name == "__Destructor" ) {1023 dtorStruct = structDecl;1024 }1025 }1026 1027 1027 void GenStructMemberCalls::premutate( FunctionDecl * funcDecl ) { 1028 1028 GuardValue( function ); … … 1037 1037 unhandled.clear(); 1038 1038 usedUninit.clear(); 1039 1040 if ( ! dtorStructDestroy && funcDecl->name == "__destroy_Destructor" ) {1041 dtorStructDestroy = funcDecl;1042 return;1043 }1044 1039 1045 1040 function = funcDecl; … … 1053 1048 if ( structType ) { 1054 1049 structDecl = structType->get_baseStruct(); 1055 if ( structDecl == dtorStruct ) return;1056 1050 for ( Declaration * member : structDecl->get_members() ) { 1057 1051 if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) { … … 1122 1116 callStmt->acceptMutator( *visitor ); 1123 1117 if ( isCtor ) { 1124 function-> statements->push_front( callStmt );1118 function->get_statements()->push_front( callStmt ); 1125 1119 } else { 1126 1120 // destructor statements should be added at the end 1127 // function->get_statements()->push_back( callStmt ); 1128 1129 // Destructor _dtor0 = { &b.a1, (void (*)(void *)_destroy_A }; 1130 std::list< Statement * > stmtsToAdd; 1131 1132 static UniqueName memberDtorNamer = { "__memberDtor" }; 1133 assertf( dtorStruct, "builtin __Destructor not found." ); 1134 assertf( dtorStructDestroy, "builtin __destroy_Destructor not found." ); 1135 1136 Expression * thisExpr = new AddressExpr( new VariableExpr( thisParam ) ); 1137 Expression * dtorExpr = new VariableExpr( getDtorFunc( thisParam, callStmt, stmtsToAdd ) ); 1138 1139 // cast destructor pointer to void (*)(void *), to silence GCC incompatible pointer warnings 1140 FunctionType * dtorFtype = new FunctionType( Type::Qualifiers(), false ); 1141 dtorFtype->parameters.push_back( ObjectDecl::newObject( "", new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), nullptr ) ); 1142 Type * dtorType = new PointerType( Type::Qualifiers(), dtorFtype ); 1143 1144 ObjectDecl * destructor = ObjectDecl::newObject( memberDtorNamer.newName(), new StructInstType( Type::Qualifiers(), dtorStruct ), new ListInit( { new SingleInit( thisExpr ), new SingleInit( new CastExpr( dtorExpr, dtorType ) ) } ) ); 1145 function->statements->push_front( new DeclStmt( destructor ) ); 1146 destructor->attributes.push_back( new Attribute( "cleanup", { new VariableExpr( dtorStructDestroy ) } ) ); 1147 1148 function->statements->kids.splice( function->statements->kids.begin(), stmtsToAdd ); 1121 function->get_statements()->push_back( callStmt ); 1149 1122 } 1150 1123 } catch ( SemanticErrorException & error ) { -
src/InitTweak/InitTweak.cc
r381bea6 r2a9d12d 339 339 std::list< Expression * > matches; 340 340 collectCtorDtorCalls( stmt, matches ); 341 assert f( matches.size() <= 1, "%zd constructor/destructors found in %s", matches.size(), toString( stmt ).c_str());341 assert( matches.size() <= 1 ); 342 342 return matches.size() == 1 ? matches.front() : nullptr; 343 343 } -
src/SymTab/Autogen.cc
r381bea6 r2a9d12d 45 45 /// Data used to generate functions generically. Specifically, the name of the generated function and a function which generates the routine protoype 46 46 struct FuncData { 47 typedef FunctionType * (*TypeGen)( Type * , bool);47 typedef FunctionType * (*TypeGen)( Type * ); 48 48 FuncData( const std::string & fname, const TypeGen & genType ) : fname( fname ), genType( genType ) {} 49 49 std::string fname; … … 231 231 232 232 /// given type T, generate type of default ctor/dtor, i.e. function type void (*) (T *) 233 FunctionType * genDefaultType( Type * paramType, bool maybePolymorphic ) { 233 FunctionType * genDefaultType( Type * paramType ) { 234 const auto & typeParams = getGenericParams( paramType ); 234 235 FunctionType *ftype = new FunctionType( Type::Qualifiers(), false ); 235 if ( maybePolymorphic ) { 236 // only copy in 237 const auto & typeParams = getGenericParams( paramType ); 238 cloneAll( typeParams, ftype->forall ); 239 } 236 cloneAll( typeParams, ftype->forall ); 240 237 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr ); 241 238 ftype->parameters.push_back( dstParam ); … … 244 241 245 242 /// given type T, generate type of copy ctor, i.e. function type void (*) (T *, T) 246 FunctionType * genCopyType( Type * paramType , bool maybePolymorphic) {247 FunctionType *ftype = genDefaultType( paramType , maybePolymorphic);243 FunctionType * genCopyType( Type * paramType ) { 244 FunctionType *ftype = genDefaultType( paramType ); 248 245 ObjectDecl *srcParam = new ObjectDecl( "_src", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 249 246 ftype->parameters.push_back( srcParam ); … … 252 249 253 250 /// given type T, generate type of assignment, i.e. function type T (*) (T *, T) 254 FunctionType * genAssignType( Type * paramType , bool maybePolymorphic) {255 FunctionType *ftype = genCopyType( paramType , maybePolymorphic);251 FunctionType * genAssignType( Type * paramType ) { 252 FunctionType *ftype = genCopyType( paramType ); 256 253 ObjectDecl *returnVal = new ObjectDecl( "_ret", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 257 254 ftype->returnVals.push_back( returnVal ); … … 311 308 for ( const FuncData & d : data ) { 312 309 // generate a function (?{}, ?=?, ^?{}) based on the current FuncData. 313 FunctionType * ftype = d.genType( type , true);310 FunctionType * ftype = d.genType( type ); 314 311 315 312 // destructor for concurrent type must be mutex -
src/SymTab/Autogen.h
r381bea6 r2a9d12d 45 45 extern FunctionDecl * dereferenceOperator; 46 46 47 /// generate the type of an assignment function for paramType. 48 /// maybePolymorphic is true if the resulting FunctionType is allowed to be polymorphic 49 FunctionType * genAssignType( Type * paramType, bool maybePolymorphic = true ); 50 51 /// generate the type of a default constructor or destructor for paramType. 52 /// maybePolymorphic is true if the resulting FunctionType is allowed to be polymorphic 53 FunctionType * genDefaultType( Type * paramType, bool maybePolymorphic = true ); 54 55 /// generate the type of a copy constructor for paramType. 56 /// maybePolymorphic is true if the resulting FunctionType is allowed to be polymorphic 57 FunctionType * genCopyType( Type * paramType, bool maybePolymorphic = true ); 47 // generate the type of an assignment function for paramType 48 FunctionType * genAssignType( Type * paramType ); 49 50 // generate the type of a default constructor or destructor for paramType 51 FunctionType * genDefaultType( Type * paramType ); 52 53 // generate the type of a copy constructor for paramType 54 FunctionType * genCopyType( Type * paramType ); 58 55 59 56 /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls. -
src/SynTree/DeclReplacer.cc
r381bea6 r2a9d12d 38 38 void previsit( TypeInstType * inst ); 39 39 }; 40 41 /// Mutator that replaces uses of declarations with arbitrary expressions, according to the supplied mapping42 struct ExprDeclReplacer {43 private:44 const ExprMap & exprMap;45 bool debug;46 public:47 ExprDeclReplacer( const ExprMap & exprMap, bool debug = false );48 49 // replace variable with new node from expr map50 Expression * postmutate( VariableExpr * varExpr );51 };52 40 } 53 41 … … 65 53 DeclMap declMap; 66 54 replace( node, declMap, typeMap, debug ); 67 }68 69 void replace( BaseSyntaxNode *& node, const ExprMap & exprMap, bool debug ) {70 PassVisitor<ExprDeclReplacer> replacer( exprMap, debug );71 node = maybeMutate( node, replacer );72 55 } 73 56 … … 96 79 } 97 80 } 98 99 ExprDeclReplacer::ExprDeclReplacer( const ExprMap & exprMap, bool debug ) : exprMap( exprMap ), debug( debug ) {}100 101 Expression * ExprDeclReplacer::postmutate( VariableExpr * varExpr ) {102 if ( exprMap.count( varExpr->var ) ) {103 Expression * replacement = exprMap.at( varExpr->var )->clone();104 if ( debug ) {105 std::cerr << "replacing variable reference: " << (void*)varExpr->var << " " << varExpr->var << " with " << (void*)replacement << " " << replacement << std::endl;106 }107 std::swap( varExpr->env, replacement->env );108 delete varExpr;109 return replacement;110 }111 return varExpr;112 }113 81 } 114 82 } // namespace VarExprReplacer -
src/SynTree/DeclReplacer.h
r381bea6 r2a9d12d 26 26 typedef std::map< DeclarationWithType *, DeclarationWithType * > DeclMap; 27 27 typedef std::map< TypeDecl *, TypeDecl * > TypeMap; 28 typedef std::map< DeclarationWithType *, Expression * > ExprMap;29 28 30 29 void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false ); 31 30 void replace( BaseSyntaxNode * node, const TypeMap & typeMap, bool debug = false ); 32 31 void replace( BaseSyntaxNode * node, const DeclMap & declMap, const TypeMap & typeMap, bool debug = false ); 33 34 void replace( BaseSyntaxNode *& node, const ExprMap & exprMap, bool debug = false);35 template<typename T>36 void replace( T *& node, const ExprMap & exprMap, bool debug = false ) {37 if ( ! node ) return;38 BaseSyntaxNode * arg = node;39 replace( arg, exprMap, debug );40 node = dynamic_cast<T *>( arg );41 assertf( node, "DeclReplacer fundamentally changed the type of its argument." );42 }43 32 } 44 33 -
tests/raii/.expect/memberCtors.txt
r381bea6 r2a9d12d 98 98 end copy construct A 99 99 End of main 100 begin destruct B101 100 constructing int 102 101 constructing int … … 147 146 destructing int: 0 148 147 destructing int: 1000 149 end destruct B 150 destructing int: 0 151 destructing int: 0 152 destructing int: 999 153 destructing int: 0 154 destructing int: 0 155 destructing int: 0 156 destructing int: 0 157 destructing int: 0 158 destructing int: 999 159 begin destruct B 148 destructing int: 0 149 destructing int: 0 150 destructing int: 999 151 destructing int: 0 152 destructing int: 0 153 destructing int: 0 154 destructing int: 0 155 destructing int: 0 156 destructing int: 999 160 157 constructing int 161 158 constructing int … … 206 203 destructing int: 0 207 204 destructing int: 1000 208 end destruct B 209 destructing int: 0 210 destructing int: 0 211 destructing int: 999 212 destructing int: 0 213 destructing int: 0 214 destructing int: 0 215 destructing int: 0 216 destructing int: 0 217 destructing int: 999 205 destructing int: 0 206 destructing int: 0 207 destructing int: 999 208 destructing int: 0 209 destructing int: 0 210 destructing int: 0 211 destructing int: 0 212 destructing int: 0 213 destructing int: 999 -
tests/raii/memberCtors.c
r381bea6 r2a9d12d 22 22 } 23 23 24 /* WrappedInt */void ?=?(WrappedInt & this, int x) {24 void ?=?(WrappedInt & this, int x) { 25 25 printf("assigning int: %d %d\n", this.x, x); 26 26 this.x = x; 27 // return this;28 27 } 29 30 // WrappedInt ?=?(WrappedInt & this, WrappedInt other) {31 // printf("assigning int: %d %d\n", this.x, other.x);32 // this.x = other.x;33 // return this;34 // }35 28 36 29 struct A { … … 86 79 87 80 void ^?{}(B & b) { 88 printf("begin destruct B\n");89 81 b.a2 = (A) { 0 }; 90 82 ^(b.a1){}; 91 printf("end destruct B\n");92 83 } // a2, a3 never destructed - will be automatically destructed 93 84 94 85 int main() { 95 86 printf("Before declaration of b1\n"); 96 B b1; // b1 = { { 1000, 0, 0 }, { 1001, 0, 0 }, { 0, 0, 0 } }87 B b1; 97 88 printf("Before declaration of b2\n"); 98 89 B b2 = b1;
Note:
See TracChangeset
for help on using the changeset viewer.