What does this warning mean?
Here is the mcve.
template<class K> class TTT{
public: alignas(alignof(K))
union{
char raw[sizeof(K)];
K rawK;
}; //<-- error at this line
};
If I compile this single file with ctrl+F7 in Visual Studio 2015, I will get this warning.
warning C4649: attributes are ignored in this context
note: see reference to class template instantiation 'TTT<K>' being compiled
I appear in my computer, but http://rextester.com can't reproduce this warning though.
Other information :-
- Notice that
TTT<K>is never really instantiated. - If I removed the word
alignas(alignof(K)), the warning will disappear. - With some test case, this class is practically usable.
I can't really find any sites that has some useful description about it.
Has anyone ever encountered it before?