Ignore:
Timestamp:
Aug 27, 2018, 4:40:34 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b7c89aa
Parents:
f9feab8 (diff), 305581d (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' into cleanup-dtors

File:
1 moved

Legend:

Unmodified
Added
Removed
  • tests/tuple/tupleVariadic.c

    rf9feab8 r90152a4  
    99// Author           : Rob Schluntz
    1010// Created On       : Fri Dec 16 10:25:35 2016
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri Dec 21 14:42:48 2016
    13 // Update Count     : 2
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug  2 09:24:04 2018
     13// Update Count     : 6
    1414//
     15
     16#include <stdlib.hfa>
    1517
    1618void func(void) {
     
    2830        printf("called process(double) %g\n", x);
    2931}
    30 
    31 forall( dtype T, ttype Params | sized(T) | { void ?{}(T &, Params); } )
    32 T * new(Params p);
    3332
    3433struct array {
     
    6867}
    6968
     69void ^?{}(array & a) {
     70        free(a.data);
     71}
     72
    7073// test use of a tuple argument
    7174[void] ?{}(array & a, [int, int, int, int] args) {
     
    9598}
    9699
     100forall(ttype T | { void foo(T); }) void bar(T x) {}
     101void foo(int) {}
     102
    97103int main() {
    98104        array * x0 = new();
     
    117123        func(3, 2.0, 111, 4.145);
    118124        printf("finished func\n");
     125
     126        {
     127                // T = [const int] -- this ensures that void(*)(int) satisfies void(*)(const int)
     128                const int x;
     129                bar(x);
     130        }
     131
     132        delete(ptr);
     133        delete(x4);
     134        delete(x3);
     135        delete(x2);
     136        delete(x1);
     137        delete(x0);
    119138}
    120139
     
    122141// tab-width: 4 //
    123142// End: //
    124 
Note: See TracChangeset for help on using the changeset viewer.