[llvm] r198273 - Silence g++ 4.9 build issue in unit tests
Alp Toker
alp at nuanti.com
Wed Jan 1 15:41:08 PST 2014
On 01/01/2014 22:35, Alp Toker wrote:
>
> On 01/01/2014 19:19, dblaikie at gmail.com wrote:
>>
>>
>> On Tue Dec 31 2013 at 11:03:34 PM, Alp Toker <alp at nuanti.com
>> <mailto: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.
>
> Works because assert() is an object-like macro and this usage is
> without parens, so not related to including headers. Still, whoever
> wrote it is pushing their luck..
>
I've changed the name for clarity in r198288.
Alp.
--
http://www.nuanti.com
the browser experts
More information about the llvm-commits
mailing list