Remove warning "suggest braces" for aggregate initialization of an empty class...
Remove warning "suggest braces" for aggregate initialization of an empty class with an aggregate base class. I recently ran into issues with aggregates and inheritance, I'm using it for creating a type-safe library where most of the types are build over "tagged" std::array. After bit of cleaning and enabling -Wall -Wextra -pedantic I noticed clang only in my pipeline gives me warning. After a bit of focusing on it I found it's not helpful, and contemplate disabling the warning all together. After a discussion with other library authors I found it's bothering more people and decided to fix it. Removes this warning: template<typename T, int N> struct StdArray { T contents[N]; }; template<typename T, int N> struct AggregateAndEmpty : StdArray<T,N> { }; AggregateAndEmpty<int, 3> p = {1, 2, 3}; // <-- warning here about omitted braces
Loading
Please register or sign in to comment