<div>
<div>
<span>Hi,</span></div><div><span><br></span></div><div><span>There are some warnings in the LLVM and clang code bases:</span></div><div><span><br></span></div><div><span>----------------------------</span></div><div><span><div>llvm[0]: Compiling RegAllocGreedy.cpp for Release+Asserts build</div><div>/Users/filcab/dev/stuff/llvm/llvm/include/llvm/ADT/SmallVector.h: In member function ‘void<unnamed>::RAGreedy::calcLiveBlockInfo(llvm::LiveInterval&)’:</div><div>/Users/filcab/dev/stuff/llvm/llvm/include/llvm/ADT/SmallVector.h:325: warning: ‘BC.llvm::SpillPlacement::BlockConstraint::Exit’ is used uninitialized in this function</div><div>----------------------------</div><div>^^ The error repeats several times.</div><div><br></div><div>It seems the error occurs when push_back copies the received object, which is a struct:</div><div><div> struct BlockConstraint {</div><div> unsigned Number; ///< Basic block number (from MBB::getNumber()).</div><div> BorderConstraint Entry : 8; ///< Constraint on block entry.</div><div> BorderConstraint Exit : 8; ///< Constraint on block exit.</div><div> };</div></div><div><br></div><div>Where only the Number member is initialized. Couldn't we initialize the other members to invalid values?</div></span><span><div><span><br></span></div>In clang, the warning is:</span></div><div><span><br></span></div><div>----------------------------</div><div><span><div>makellvm[0]: Compiling SemaTemplateVariadic.cpp for Release+Asserts build</div><div>/Users/filcab/dev/stuff/llvm/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp: In member function ‘bool clang::Sema::CheckParameterPacksForExpansion(clang::SourceLocation, clang::SourceRange, const clang::UnexpandedParameterPack*, unsigned int, const clang::MultiLevelTemplateArgumentList&, bool&, bool&, llvm::Optional<unsigned int>&)’:</div><div>/Users/filcab/dev/stuff/llvm/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp:479: warning: ‘Index’ may be used uninitialized in this function</div><div>/Users/filcab/dev/stuff/llvm/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp:478: warning: ‘Depth’ may be used uninitialized in this function</div><div>----------------------------</div><div><br></div></span></div><div><span>It seems the problem gcc is seeing is:</span></div><div><br></div><div>the dyn_cast to cons TemplateTypeParmType fails</div><div>isa<ParlVarDecl>(ND) is true</div><div>Instantiation && Instantiation->is<DeclArgumentPack *>() is true</div><div>CurrentInstantiationScope->getPartiallySubstitutedPack() is true</div><div><br></div><div>I don't know enough about clang to know how feasible this path is, so I defer to this list.</div><div><span><br></span></div><div><span><br></span></div><div><span>BTW, clang++ doesn't warn about any of these "problems" (by using make CXX=clang++)<br><br></span></div><div><span>Regards,</span></div><div><span><br></span></div><div><span> Filipe Cabecinhas<br><br></span>
</div>
</div>