DUChain support of defaulted/deleted functions again

Wolfgang Bangerth bangerth at math.tamu.edu
Sun Jun 19 21:18:33 UTC 2011


> Do we even need to track deleted declarations at all? Wouldn't it be
> enough to simply not create them?

I don't know the current representation in KDevelop, but the point of 
=delete'ing a declaration is that the compiler would otherwise create it 
itself. Say, for example, a copy constructor -- the compiler would create it 
by itself if you don't do it yourself; strictly speaking, KDevelop would have 
to implicitly create this declaration for its internal representation as well, 
but omit this implicit declaration if the copy constructor is =delete'd.

That said, I'm not sure whether it is useful to track this information. After 
all, if I have something like this:
  struct X {};
  void f() {
    X x;
    x.foo();
  }
then KDevelop happily lets me use this member function foo() even though it 
doesn't exist. Tracking whether a special function is deleted only makes sense 
if KDevelop were going to take action if a user was going to use this function 
and remind her that that is an error -- but I tend to think that this would be 
better left to the compiler. (Or is the standard way of reporting such errors 
in the "Problems" tool view, which indeed shows me that foo doesn't exist?)

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