[llvm-commits] [llvm] r170031 - /llvm/trunk/include/llvm/Support/YAMLTraits.h

Benjamin Kramer benny.kra at gmail.com
Wed Dec 12 14:46:23 PST 2012


On 12.12.2012, at 23:27, Nick Kledzik <kledzik at apple.com> wrote:

> 
> On Dec 12, 2012, at 2:14 PM, Benjamin Kramer wrote:
> 
>> 
>> On 12.12.2012, at 23:03, Nick Kledzik <kledzik at apple.com> wrote:
>> 
>>> Author: kledzik
>>> Date: Wed Dec 12 16:03:57 2012
>>> New Revision: 170031
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=170031&view=rev
>>> Log:
>>> AlignedCharArrayUnion is erroring with non-clang compilers
>>> 
>>> Modified:
>>>  llvm/trunk/include/llvm/Support/YAMLTraits.h
>>> 
>>> Modified: llvm/trunk/include/llvm/Support/YAMLTraits.h
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/YAMLTraits.h?rev=170031&r1=170030&r2=170031&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/include/llvm/Support/YAMLTraits.h (original)
>>> +++ llvm/trunk/include/llvm/Support/YAMLTraits.h Wed Dec 12 16:03:57 2012
>>> @@ -630,9 +630,9 @@
>>> TNorm* operator->() { return BufPtr; }
>>> 
>>> private:
>>> -  typedef typename llvm::AlignedCharArrayUnion<TNorm> Storage;
>>> -
>>> -  Storage       Buffer;
>>> +  //typedef typename llvm::AlignedCharArrayUnion<TNorm> Storage;
>>> +  //Storage       Buffer;
>>> +  char          Buffer[sizeof(TNorm)];
>> 
>> How about just removing the "typename" specifier? I don't think it's necessary here. GCC eats that.
> 
> Well, the error message is below, and given this is template expansion, I'm not sure what 'class' tag it is complaining about.
> 
> -Nick
> 
> In file included from YAMLTraits.cpp:11:0:
> /home/llvmbuild/llvm-ppc64/llvm/include/llvm/Support/YAMLTraits.h:633:26: error: ‘class’ tag used in naming ‘union llvm::AlignedCharArrayUnion<T>’ [-fpermissive]
> In file included from /home/llvmbuild/llvm-ppc64/llvm/include/llvm/ADT/DenseMap.h:18:0,
>                 from /home/llvmbuild/llvm-ppc64/llvm/include/llvm/Support/YAMLTraits.h:14,
>                 from YAMLTraits.cpp:11:
> /home/llvmbuild/llvm-ppc64/llvm/include/llvm/Support/AlignOf.h:144:7: note: ‘union llvm::AlignedCharArrayUnion<T>’ was previously declared here
> In file included from YAMLTraits.cpp:11:0:

I committed r170036 with a fix for this and many other things. Sorry for the big change but this was necessary to bring the buildbots back to life and felt like a better option than reverting everything.

It should build with GCC and clang now and your unittest should link without errors.

- Ben
> 
> 
>> 
>>> IO           &io;
>>> TNorm        *BufPtr;
>>> TFinal       &Result;
>>> @@ -666,9 +666,9 @@
>>> TNorm* operator->() { return BufPtr; }
>>> 
>>> private:
>>> -  typedef typename llvm::AlignedCharArrayUnion<TNorm> Storage;
>>> -
>>> -  Storage       Buffer;
>>> +  //typedef typename llvm::AlignedCharArrayUnion<TNorm> Storage;
>>> +  //Storage       Buffer;
>>> +  char          Buffer[sizeof(TNorm)];
>>> IO           &io;
>>> TNorm        *BufPtr;
>>> TFinal       &Result;
>>> 
>>> 
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
> 





More information about the llvm-commits mailing list