On Mon, Feb 3, 2014 at 9:45 AM, Jordan Rose <[email protected]> wrote:
>
>   This is fine but it doesn't turn it on for anybody. Unless Richard has
> any objections, I think it's fine to turn this on for -Wuninitialized, just
> not for the analyzer. It looks like one good place to do this is in
> AnalysisManager, which is only used by the analyzer.


In principle I'm strongly in favour of enabling this for -Wuninitialized. I
think we want this for -Wthread-safety, -Wconsumed, and
-Winfinite-recursion too. But I think it'll do the wrong thing for
-Wunreachable-code right now:

  struct S {
    bool b;
    int n = b ? 1 : 2;
    S() : b(true) {} // warning, '2' above is unreachable
  };

Sema's analysis-based warnings only builds one CFG for all its analyses, so
I think we'll need to teach -Wunreachable-code to do the right thing here
before we can enable this in AnalysisBasedWarnings. Hopefully we can
suppress 'unreachable' diagnostics inside CXXDefaultInitExprs easily enough?
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to