[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[creduce-bugs] [creduce] Incorrect assignment due to different types (#1) (fwd)



The failing compilation was caused by the changes in Clang commit 
r155808. I've pulled your request to the master branch. Thanks for 
sending us the patch!

- Yang

Eric Eide wrote:
>
> ------------------------------------------------------------------------
>
> Subject:
> [creduce] Incorrect assignment due to different types (#1)
> From:
> Paulo Jorge Matos 
> <reply+i-4407014-2dec18c69fa6ad4574fdf0ad73d3000cc5737550-160140 at reply.github.com> 
>
> Date:
> Thu, 3 May 2012 08:13:52 -0700
> To:
> Eric Eide <eeide at cs.utah.edu>
>
> To:
> Eric Eide <eeide at cs.utah.edu>
>
>
> While trying to build (with gcc 4.6.3) clang-delta plugin I got these errors:
> ```
> UnionToStruct.cpp: In member function ?bool UnionToStruct::isValidRecordDecl(const clang::RecordDecl*)?:
> UnionToStruct.cpp:153:30: error: cannot convert ?clang::FieldDecl? to ?const clang::FieldDecl*? in initialization
> UnionToStruct.cpp: In member function ?void UnionToStruct::getInitStrWithPointerType(const clang::Expr*, std::string&)?:
> UnionToStruct.cpp:222:30: error: cannot convert ?clang::FieldDecl? to ?const clang::FieldDecl*? in initialization
> UnionToStruct.cpp: In member function ?void UnionToStruct::getInitStrWithNonPointerType(const clang::Expr*, std::string&)?:
> UnionToStruct.cpp:248:30: error: cannot convert ?clang::FieldDecl? to ?const clang::FieldDecl*? in initialization
> RemoveUnusedStructField.cpp: In member function ?bool RemoveUnusedStructFieldRewriteVisitor::VisitRecordDecl(clang::RecordDecl*)?:
> RemoveUnusedStructField.cpp:92:30: error: cannot convert ?clang::FieldDecl? to ?const clang::FieldDecl*? in initialization
> RemoveUnusedStructField.cpp: In member function ?void RemoveUnusedStructField::setBaseLine(const clang::RecordDecl*, const clang::FieldDecl*)?:
> RemoveUnusedStructField.cpp:157:28: error: no match for ?operator==? in ?FD == I.clang::DeclContext::specific_decl_iterator<SpecificDecl>::operator* [with SpecificDecl = clang::FieldDecl, clang::DeclContext::specific_decl_iterator<SpecificDecl>::reference = clang::FieldDecl&]()?
> RemoveUnusedStructField.cpp:157:28: note: candidates are:
> /localhome/pmatos/local/llvm-githead/include/clang/AST/CanonicalType.h:189:13: note: template<class T, class U> bool clang::operator==(clang::CanQual<T>, clang::CanQual<U>)
> /localhome/pmatos/local/llvm-githead/include/clang/Basic/SourceLocation.h:172:13: note: bool clang::operator==(const clang::SourceLocation&, const clang::SourceLocation&)
> /localhome/pmatos/local/llvm-githead/include/clang/Basic/SourceLocation.h:172:13: note:   no known conversion for argument 1 from ?const clang::FieldDecl*? to ?const clang::SourceLocation&?
> RemoveUnusedStructField.cpp: In member function ?const clang::FieldDecl* RemoveUnusedStructField::getFieldDeclByIdx(const clang::RecordDecl*, unsigned int)?:
> RemoveUnusedStructField.cpp:214:18: error: cannot convert ?clang::FieldDecl? to ?const clang::FieldDecl*? in return
> ```
>
> This is all the same problem. The result of doing a *I where I is a fiel_iterator is a FieldDecl, not a FieldDecl*. 
>
> You can merge this Pull Request by running:
>
>   git pull https://github.com/pmatos/creduce master
>
> Or you can view, comment on it, or merge it online at:
>
>   https://github.com/csmith-project/creduce/pull/1
>
> -- Commit Summary --
>
> * Fix incorrect assignment. Field iterator does not return pointer.
>
> -- File Changes --
>
> M clang_delta/RemoveUnusedStructField.cpp (6)
> M clang_delta/UnionToStruct.cpp (6)
>
> -- Patch Links --
>
>   https://github.com/csmith-project/creduce/pull/1.patch
>   https://github.com/csmith-project/creduce/pull/1.diff
>
> --- 
> Reply to this email directly or view it on GitHub:
> https://github.com/csmith-project/creduce/pull/1
>