Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge changes from the upstream project #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

trondn
Copy link

@trondn trondn commented Jun 18, 2018

Merge all of the changes in the master branch from git://github.com/google/googletest

daverigby and others added 3 commits February 15, 2016 14:51
The Clang Static Analyzer[1] encounters some issues parsing
GoogleTest's macros, mostly where GoogleTest has deliberately
attempted to obfuscate the behavour of some code to work around
compiler warnings. Specifically, GTest defines a AlwaysTrue() function
which in reality always returns true, but who's definition lives in a
seperate compilation unit which prevents compilers (and Clang
analyzer) from knowing that certain paths are always (or never)
executed.

The net effect of this is that Clang analyzer raises a number of false
positives. For example consider code of the form:

    1    Foo* foo = nullptr;
    2    ASSERT_NO_THROW(foo = some_function());
    3    foo->bar;

In practice foo is guaranteed to be non-NULL at line 3, as if the
assignment at line 2 failed then we wouldn't have reached line
3. However the expansion of the ASSERT_NO_THROW macro involves code of
the form:

    if (AlwaysTrue()) {
        try { foo = ... }
    } ...

The analyzer doesn't know that the conditional will /always/ be
executed, so it belives there's a path where foo is not initialized at
line 3 and hence raises a report.

Solve this by making the function inline when running with clang
analyzer, un-hiding the definition and allowing Clang to see that the
conditional path is actually unconditional.

[1]: http://clang-analyzer.llvm.org

Change-Id: I72906e9f1f9c283bc52178730c99bf171a7c966a
* upstream/master: (563 commits)
  Eliminate GTEST_TEST_FILTER_ENV_VAR_.
  ignore .md for appveyor builds
  Docs sync/internal
  Doc sync/internal
  Reduce the number of strcmp calling while initialization
  Sync with internal docs
  Sync with internal docs
  Removed "Documentation.md" not adding value and not consitent with internal docs
  Rename Samples.md to samples.md and adjust the links
  Rename FAQ.md to faq.md and adjust the links.
  Rename AdvancedGuide.md to advanced.md and adjust the links. Part of documentation rationalization work
  Rename "Primer.md" to "primer.md" and adjust links. Part of the documentaion rationalzation
  Fuchsia: Change fdio include path.
  Upstream, cl/199129756
  Clean up
  Remvoe launchpad dependency from Fuchsia.
  formatting changes
  Formatting changes
  Downgrade to C++98.
  Downgrade to C++98 code.
  ...
cb-robot pushed a commit that referenced this pull request Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants