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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalc...@gcc.gnu.org>:

https://gcc.gnu.org/g:75038aa6aa5b562e6358108619d66ef2ccab9a53

commit r10-6151-g75038aa6aa5b562e6358108619d66ef2ccab9a53
Author: David Malcolm <dmalc...@redhat.com>
Date:   Fri Jan 17 09:50:33 2020 -0500

    analyzer: introduce namespace to avoid ODR clashes (PR 93307)

    PR analyzer/93307 reports that in an LTO bootstrap, there are ODR
    violations between:
    - the "region" type:
        gcc/analyzer/region-model.h:792
      vs:
        gcc/sched-int.h:1443
    - the "constraint" type:
        gcc/analyzer/constraint-manager.h:121
      vs:
        gcc/tree-ssa-structalias.c:533

    This patches solves this clash by putting all of the analyzer names
    within a namespace.  I chose "ana" as it is short (to save typing).
    The analyzer selftests are moved from namespace "selftest" to
    "ana::selftest".

    There are various places where the namespace has to be closed
    and reopened, to allow e.g. for specializations of templates
    in the global namespace.

    gcc/analyzer/ChangeLog:
        PR analyzer/93307
        * analysis-plan.h: Wrap everything namespace "ana".
        * analyzer-logging.cc: Likewise.
        * analyzer-logging.h: Likewise.
        * analyzer-pass.cc (pass_analyzer::execute): Update for "ana"
        namespace.
        * analyzer-selftests.cc: Wrap everything namespace "ana".
        * analyzer-selftests.h: Likewise.
        * analyzer.h: Likewise for forward decls of types.
        * call-string.h: Likewise.
        * checker-path.cc: Likewise.
        * checker-path.h: Likewise.
        * constraint-manager.cc: Likewise.
        * constraint-manager.h: Likewise.
        * diagnostic-manager.cc: Likewise.
        * diagnostic-manager.h: Likewise.
        * engine.cc: Likewise.
        * engine.h: Likewise.
        * exploded-graph.h: Likewise.
        * function-set.cc: Likewise.
        * function-set.h: Likewise.
        * pending-diagnostic.cc: Likewise.
        * pending-diagnostic.h: Likewise.
        * program-point.cc: Likewise.
        * program-point.h: Likewise.
        * program-state.cc: Likewise.
        * program-state.h: Likewise.
        * region-model.cc: Likewise.
        * region-model.h: Likewise.
        * sm-file.cc: Likewise.
        * sm-malloc.cc: Likewise.
        * sm-pattern-test.cc: Likewise.
        * sm-sensitive.cc: Likewise.
        * sm-signal.cc: Likewise.
        * sm-taint.cc: Likewise.
        * sm.cc: Likewise.
        * sm.h: Likewise.
        * state-purge.h: Likewise.
        * supergraph.cc: Likewise.
        * supergraph.h: Likewise.

    gcc/ChangeLog:
        PR analyzer/93307
        * gdbinit.in (break-on-saved-diagnostic): Update for move of
        diagnostic_manager into "ana" namespace.
        * selftest-run-tests.c (selftest::run_tests): Update for move of
        selftest::run_analyzer_selftests to
        ana::selftest::run_analyzer_selftests.

Reply via email to