ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        jacob/cs343-translation
        jenkins-sandbox
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        resolv-new
        with_gc
      
      
        
          | 
            Last change
 on this file since 1cb758f2 was             f92aa32, checked in by Rob Schluntz <rschlunt@…>, 9 years ago           | 
        
        
          | 
             
thesis conclusions and editting pass 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            422 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include <iostream>
 | 
|---|
| 2 | using namespace std;
 | 
|---|
| 3 | 
 | 
|---|
| 4 | struct S {
 | 
|---|
| 5 |   int x;
 | 
|---|
| 6 | };
 | 
|---|
| 7 | 
 | 
|---|
| 8 | void _dtor_S(S * s) {
 | 
|---|
| 9 |   cout << "called destructor!" << endl;
 | 
|---|
| 10 | }
 | 
|---|
| 11 | 
 | 
|---|
| 12 | S f() {
 | 
|---|
| 13 |   throw 3;
 | 
|---|
| 14 |   return (S) { 0 };
 | 
|---|
| 15 | }
 | 
|---|
| 16 | 
 | 
|---|
| 17 | void _ctor_S(struct S *s, struct S) {
 | 
|---|
| 18 |   s->x = 123;
 | 
|---|
| 19 | }
 | 
|---|
| 20 | 
 | 
|---|
| 21 | int main() {
 | 
|---|
| 22 |   try {
 | 
|---|
| 23 | //    __attribute__((cleanup(_dtor_S))) S s = f();
 | 
|---|
| 24 |   struct S _tmp1;
 | 
|---|
| 25 |   struct S _tmp2 = (_ctor_S(&_tmp2, _tmp1), _tmp2);
 | 
|---|
| 26 |   cout << _tmp2.x << endl;
 | 
|---|
| 27 | 
 | 
|---|
| 28 |   } catch(...) {
 | 
|---|
| 29 | 
 | 
|---|
| 30 |   }
 | 
|---|
| 31 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.