https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105949

            Bug ID: 105949
           Summary: RFE: analyzer could warn about calls to vfuncs within
                    a ctor/dtor
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
            Blocks: 97110, 105887
  Target Milestone: ---

Perhaps -fanalyzer should complain about vfunc calls within a ctor/dtor (and
check interprocedurally)

clang's static analyzer has:
 
https://clang.llvm.org/docs/analyzer/checkers.html#optin-cplusplus-virtualcall-c

and various C++ guides make recommendations to avoid such calls (including
Scott Meyers', if I remember correctly)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110
[Bug 97110] [meta-bug] tracker bug for supporting C++ in -fanalyzer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105887
[Bug 105887] [meta-bug] clang analyzer warnings that GCC's -fanalyzer could
implement

Reply via email to