Clang online demo: no warning!

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

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

That's correct. Tanya only recently switched the demo page over to
clang (previously it used llvm-gcc and was intended really only as a
demo of LLVM, not of the compiler - hence no warning flags, etc.
Everyone's seen GCC's warnings before) & it hasn't really been spruced
up to take advantage of, or show off, clang as yet.

I've got a CR out at the moment to add coloring support to the
diagnostic output (you'll see that it does produce at least one
warning for the example code - an unused parameter - but that it's
just plain black text rather than the nice multicolored, highlighted,
etc output you might be used to seeing from clang) & after that I've
got some ideas about adding warning levels and maybe support for the
clang static analyzer.

I don't have any specific plans about the layout/design of the page in
the long term with these additions, so there's still a lot to hash out
in terms of what functionality is provided (do we need the ability to
turn warnings on & off, or is a simple "hey, this is how awesome
clang's diagnostics are, but you can turn them off in the real
product" sufficient to waylay any user fears that they're going to end
up with a really noisy build if they use clang).

- David