Ignore:
Timestamp:
Dec 22, 2016, 4:07:58 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
1e3d5b6
Parents:
907eccb
Message:

allow construction, destruction, and assignment for empty tuples, allow matching a ttype parameter with an empty tuple, fix specialization to work with empty tuples and void functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleExpansion.cc

    r907eccb r4c8621ac  
    225225                                decl->get_parameters().push_back( tyParam );
    226226                        }
     227                        if ( tupleType->size() == 0 ) {
     228                                // empty structs are not standard C. Add a dummy field to empty tuples to silence warnings when a compound literal Tuple0 is created.
     229                                decl->get_members().push_back( new ObjectDecl( "dummy", DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) );
     230                        }
    227231                        typeMap[mangleName] = decl;
    228232                        addDeclaration( decl );
Note: See TracChangeset for help on using the changeset viewer.