[benchmark] Fixed a build error when using CMake 3.15.1 + NDK-R20
authorAnZhong Huang <Anzhong.huang@amd.com>
Mon, 28 Dec 2020 08:24:29 +0000 (11:24 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 28 Dec 2020 08:24:56 +0000 (11:24 +0300)
commita485a59d2172daaee1d5e734da54fbb243f7d54c
tree2e649d291bae31435a63beaa4b9a28f41d711e2a
parentd85a198e85253b6b39d9b86eb7afd3332637bcbe
[benchmark] Fixed a build error when using CMake 3.15.1 + NDK-R20

std::decay_t used by llvm/utils/benchmark/include/benchmark/benchmark.h
is a c++14 feature, but the CMakelist uses c++11,
it's the root-cause of build error.

There are two options to fix the error.
1) change the CMakelist to support c++14.
2) change std::decay_t to std::decay, it's what the patch done.

This bug can only be reproduced by CMake 3.15, we didn't observer the bug
with CMake 3.16. But based on the code's logic, it's an obvious bug of LLVM.

The upstream code is fine, the problem was introduced by
rG1bd6123b781120c9190b9ba58b900cdcb718cdd1.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D93794
llvm/utils/benchmark/include/benchmark/benchmark.h