[cfe-dev] Clang online demo: no warning!

Matthieu Monrocq matthieu.monrocq at gmail.com
Wed Aug 10 00:16:44 PDT 2011


Hello,

I wanted to demo Clang useful warnings and thought of using the newly
reworked online demo (thanks Tanya !).

I put on this code:

class NotSufficientlyVirtual {
protected:
  ~NotSufficientlyVirtual() {}
private:
  virtual void foo() {}
};

void erase(NotSufficientlyVirtual* NSV) {
  delete NSV;
}

Which was supposed to trigger (from DiagnosticSemaKinds.td):

def warn_delete_non_virtual_dtor : Warning<
  "delete called on %0 that has virtual functions but non-virtual destructor">,
  InGroup<DeleteNonVirtualDtor>, DefaultIgnore;

Which normally is part of:

def Most : DiagGroup<"most", [
    CharSubscript,
    Comment,
    DeleteNonVirtualDtor,

But the warning did not appear, leading me to think that the CGI script does
not pass -Wall when invoking Clang.

I find this quite unfortunate, as Clang has really great diagnostics and the
online demo does not, thus, allow one to demonstrate those warnings.

Would it be possible/useful to activate -Wall ? (and perhaps -Wextra) ?

--Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110810/270db5f8/attachment.html>


More information about the cfe-dev mailing list