DUChain support of defaulted/deleted functions again
Wolfgang Bangerth
bangerth at math.tamu.edu
Sun Jun 19 18:19:00 UTC 2011
> - I can't think of an example of using =default on a non-member function
> generally, it's not that clear to me what can and what cannot be defaulted.
> a whitelist would be cool, or if someone could point me to the correct
> part in the spec that defines this
=default only makes sense if the compiler can know how to generate a
particular version. This is only true for constructors, destructors, and copy
operators as well as operator new/delete.
According to N3242, section 8.4.2, =default is indeed restricted to "special
member functions", a term defined in section 12.
> I just don't know whether putting it directly into Declaration is a good
> place. For one thing this is a pure C++0x feature, I don't know of any
> other language with a similar feature. To make matters worse only
> FunctionDeclarations can be deleted in C++0x... If preferred I could simply
> create a CppFunctionDeclaration that also tracks the isSignal/isSlot and
> thus cleans our API a bit of Cpp-Isms...
In GCC's language-independent internal representation of functions and similar
things, they store some information in "lang_flags" -- essentially bits in
their data structures that are interpreted differently by different language
front ends. They have a generic name, and are accessed by (global, not member)
functions in the front end that are named to indicate what the meaning of this
generically named flag is in the language front end currently in use.
Best
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth at math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/
More information about the KDevelop-devel
mailing list