Mercurial > projects > ldc
comparison dmd/class.c @ 1530:05c235309d6f
Make the auto storage class never have the same meaning as scope.
This changes the meaning of
auto class MyClass {} and
auto MyClass ident;
Both have been made an error to prevent accidents.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 12 Jul 2009 16:15:21 +0200 |
parents | 8026319762be |
children | def7a1d494fd |
comparison
equal
deleted
inserted
replaced
1529:ad7f2f1862d6 | 1530:05c235309d6f |
---|---|
182 Module::moduleinfo = this; | 182 Module::moduleinfo = this; |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 com = 0; | 186 com = 0; |
187 isauto = 0; | 187 isscope = 0; |
188 isabstract = 0; | 188 isabstract = 0; |
189 isnested = 0; | 189 isnested = 0; |
190 vthis = NULL; | 190 vthis = NULL; |
191 inuse = 0; | 191 inuse = 0; |
192 } | 192 } |
445 vtbl.setDim(baseClass->vtbl.dim); | 445 vtbl.setDim(baseClass->vtbl.dim); |
446 memcpy(vtbl.data, baseClass->vtbl.data, sizeof(void *) * vtbl.dim); | 446 memcpy(vtbl.data, baseClass->vtbl.data, sizeof(void *) * vtbl.dim); |
447 | 447 |
448 // Inherit properties from base class | 448 // Inherit properties from base class |
449 com = baseClass->isCOMclass(); | 449 com = baseClass->isCOMclass(); |
450 isauto = baseClass->isauto; | 450 isscope = baseClass->isscope; |
451 vthis = baseClass->vthis; | 451 vthis = baseClass->vthis; |
452 } | 452 } |
453 else | 453 else |
454 { | 454 { |
455 // No base class, so this is the root of the class hierarchy | 455 // No base class, so this is the root of the class hierarchy |
527 } | 527 } |
528 } | 528 } |
529 } | 529 } |
530 } | 530 } |
531 | 531 |
532 if (storage_class & (STCauto | STCscope)) | 532 if (storage_class & STCauto) |
533 isauto = 1; | 533 error("storage class has no effect: auto"); |
534 if (storage_class & STCscope) | |
535 isscope = 1; | |
534 if (storage_class & STCabstract) | 536 if (storage_class & STCabstract) |
535 isabstract = 1; | 537 isabstract = 1; |
536 | 538 |
537 sc = sc->push(this); | 539 sc = sc->push(this); |
538 sc->stc &= ~(STCfinal | STCauto | STCscope | STCstatic | | 540 sc->stc &= ~(STCfinal | STCauto | STCscope | STCstatic | |