r335854 - Fix unittest build with GCC older than 5.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 06:39:42 PDT 2018


Thanks! I was going to push the same fix, but you also explained why it's
needed ;)

On Thu, Jun 28, 2018 at 3:36 PM Benjamin Kramer via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: d0k
> Date: Thu Jun 28 06:31:36 2018
> New Revision: 335854
>
> URL: http://llvm.org/viewvc/llvm-project?rev=335854&view=rev
> Log:
> Fix unittest build with GCC older than 5.
>
> Old GCCs have an annoying bug where RVO disables the automatic
> conversion to base for unique_ptr. Add a pessimizing std::move as a
> workaround.
>
> Modified:
>     cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
>
> Modified: cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp?rev=335854&r1=335853&r2=335854&view=diff
>
> ==============================================================================
> --- cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
> (original)
> +++ cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp Thu
> Jun 28 06:31:36 2018
> @@ -61,7 +61,7 @@ public:
>      AnalysisConsumer->AddCheckerRegistrationFn([](CheckerRegistry
> &Registry) {
>        Registry.addChecker<CustomChecker>("custom.CustomChecker",
> "Description");
>      });
> -    return AnalysisConsumer;
> +    return std::move(AnalysisConsumer);
>    }
>  };
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180628/860a08b1/attachment.html>


More information about the cfe-commits mailing list