Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/Sema/CheckExprLifetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ shouldTrackFirstArgumentForConstructor(const CXXConstructExpr *Ctor) {
if (LHSRecordDecl->hasAttr<PointerAttr>())
return true;

if (Ctor->getConstructor()->getNumParams() != 1 ||
if (Ctor->getConstructor()->param_empty() ||
!isContainerOfPointer(LHSRecordDecl))
return false;

Expand Down
6 changes: 4 additions & 2 deletions clang/test/Sema/warn-lifetime-analysis-nocfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,16 @@ template<typename T>
struct initializer_list {
const T* ptr; size_t sz;
};
template <typename T>
template<typename T> class allocator {};
template <typename T, typename Alloc = allocator<T>>
struct vector {
typedef __gnu_cxx::basic_iterator<T> iterator;
iterator begin();
iterator end();
const T *data() const;
vector();
vector(initializer_list<T> __l);
vector(initializer_list<T> __l,
const Alloc& alloc = Alloc());

template<typename InputIterator>
vector(InputIterator first, InputIterator __last);
Expand Down
Loading