[llvm] r188528 - Calling the base class constructor from the derived class' initializer list. This matches DenseMap's behavior, and silences some warnings.

Aaron Ballman aaron at aaronballman.com
Fri Aug 16 05:53:17 PDT 2013


Done (good idea!): http://llvm.org/bugs/show_bug.cgi?id=16913

~Aaron

On Fri, Aug 16, 2013 at 2:05 AM, David Blaikie <dblaikie at gmail.com> wrote:
> On Thu, Aug 15, 2013 at 8:28 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
>> On Thu, Aug 15, 2013 at 11:17 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>>> On Thu, Aug 15, 2013 at 7:56 PM, Aaron Ballman <aaron at aaronballman.com>
>>> wrote:
>>>>
>>>> Author: aaronballman
>>>> Date: Thu Aug 15 21:56:43 2013
>>>> New Revision: 188528
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=188528&view=rev
>>>> Log:
>>>> Calling the base class constructor from the derived class' initializer
>>>> list.  This matches DenseMap's behavior, and silences some warnings.
>>>>
>>>
>>> Your change isn't actually doing anything semantically; what warning is
>>> this?
>>
>> It's another MinGW warning from the build bots:
>>
>> http://lab.llvm.org:8011/builders/clang-x86_64-darwin11-self-mingw32/builds/13154/steps/compile/logs/warnings%20%2811%29
>>
>> /Volumes/Macintosh_HD2/buildbots/clang-x86_64-darwin11-self-mingw32/llvm.src/include/llvm/ADT/DenseMap.h:716:
>> warning: base class 'class
>> llvm::DenseMapBase<llvm::SmallDenseMap<unsigned int, unsigned int, 4u,
>> llvm::DenseMapInfo<unsigned int> >, unsigned int, unsigned int,
>> llvm::DenseMapInfo<unsigned int> >' should be explicitly initialized
>> in the copy constructor
>
> Could you file a bug for Clang to implement a better version of this?
> (I assume, given the change you made to fix this, that the base class
> is stateless & thus uninteresting for copy operations - a better
> implementation of this warning wouldn't warn in this case & Clang
> could implement that, then we could disable this sub-optimal warning
> in favor of the better version)



More information about the llvm-commits mailing list