[llvm] r198273 - Silence g++ 4.9 build issue in unit tests

dblaikie at gmail.com dblaikie at gmail.com
Wed Jan 1 11:19:24 PST 2014


On Tue Dec 31 2013 at 11:03:34 PM, Alp Toker <alp at nuanti.com> wrote:

> Author: alp
> Date: Wed Jan  1 00:57:01 2014
> New Revision: 198273
>
> URL: http://llvm.org/viewvc/llvm-project?rev=198273&view=rev
> Log:
> Silence g++ 4.9 build issue in unit tests
>
> Stopgap measure until we can just use static_assert().
>
> Modified:
>     llvm/trunk/unittests/IR/ValueMapTest.cpp
>
> Modified: llvm/trunk/unittests/IR/ValueMapTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/
> IR/ValueMapTest.cpp?rev=198273&r1=198272&r2=198273&view=diff
> ============================================================
> ==================
> --- llvm/trunk/unittests/IR/ValueMapTest.cpp (original)
> +++ llvm/trunk/unittests/IR/ValueMapTest.cpp Wed Jan  1 00:57:01 2014
> @@ -117,7 +117,8 @@ TYPED_TEST(ValueMapTest, OperationsWork)
>
>  template<typename ExpectedType, typename VarType>
>  void CompileAssertHasType(VarType) {
> -  typedef char assert[is_same<ExpectedType, VarType>::value ? 1 : -1];
> +  LLVM_ATTRIBUTE_UNUSED typedef char
> +  assert[is_same<ExpectedType, VarType>::value ? 1 : -1];
>

Naming something 'assert' which is a standard macro (even if the standard
header that defines it is not included) seems questionable.

& is there a reason we're not using the LLVM_STATIC_ASSERT macro here?


>  }
>
>  TYPED_TEST(ValueMapTest, Iteration) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140101/1404717a/attachment.html>


More information about the llvm-commits mailing list