Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

dmd.semantic3

Performs the semantic3 stage of semantic analysis, which finalizes function bodies and late semantic checks for templates, mixins, aggregates, and special members.
Authors:

Source semantic3.d

void semantic3(Dsymbol dsym, Scope* sc);
Does semantic analysis on function bodies.
FuncDeclaration search_toString(StructDeclaration sd);
Search sd for a member function of the form: extern (D) string toString();
Parameters:
StructDeclaration sd struct declaration to search
Returns:
FuncDeclaration of toString() if found, null if not
void semanticTypeInfoMembers(StructDeclaration sd);
Ensures special members of a struct are fully analysed before the backend emits TypeInfo.
Handles late semantic analysis for members like opEquals, opCmp, toString, toHash, postblit, and destructor.
bool checkClosure(FuncDeclaration fd);
Determine whether the given function will need to allocate a closure_ and verify that such an allocation is allowed under the current compilation settings.
Whenever an error is emitted, every nested function that actually closes over a variable is listed in a supplemental diagnostic, together with the location of the captured variable’s declaration. (This extra walk is skipped when the compiler is gagged.)
See Also:
  • FuncDeclaration.needsClosure
  • FuncDeclaration.setGC
  • FuncDeclaration.printGCUsage