From d571eea5e0db578d80205589e7d0b5c2e85ff95f Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 23 Apr 2011 18:31:07 +0200 Subject: [PATCH] Merged DMD commit d19e57c3f0683ac3a0b290f5b73deb86aa1a6441: 5105 Member function template cannot be synchronized Patch by rsinfu --- dmd/func.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dmd/func.c b/dmd/func.c index d88f64c4..e97a1bd4 100644 --- a/dmd/func.c +++ b/dmd/func.c @@ -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());