/* BUG: should check:
* o no virtual functions or non-static data members of classes
*/
+ semanticRun = PASSsemanticdone;
}
const char *TemplateDeclaration::kind() const
if (tiargs && tiargs->dim > 0)
return 0;
- if (fd->semanticRun == PASSinit && fd->_scope)
+ // constructors need a valid scope in order to detect semantic errors
+ if (!fd->isCtorDeclaration() &&
+ fd->semanticRun < PASSsemanticdone)
{
Ungag ungag = fd->ungagSpeculative();
- fd->semantic(fd->_scope);
+ fd->semantic(NULL);
}
- if (fd->semanticRun == PASSinit)
+ if (fd->semanticRun < PASSsemanticdone)
{
::error(loc, "forward reference to template %s", fd->toChars());
return 1;