Merged DMD commit d19e57c3f0683ac3a0b290f5b73deb86aa1a6441:

5105 Member function template cannot be synchronized

Patch by rsinfu
This commit is contained in:
David Nadlinger
2011-04-23 18:31:07 +02:00
parent 907067c4e8
commit d571eea5e0

View File

@@ -1482,7 +1482,8 @@ void FuncDeclaration::semantic3(Scope *sc)
// wrap body of synchronized functions in a synchronized statement
if (isSynchronized())
{
ClassDeclaration *cd = parent->isClassDeclaration();
AggregateDeclaration *ad = isThis();
ClassDeclaration *cd = ad ? ad->isClassDeclaration() : NULL;
if (!cd)
error("synchronized function %s must be a member of a class", toChars());