Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect assignment due to different types #1

Merged
merged 1 commit into from
May 3, 2012

Conversation

pmatos
Copy link
Contributor

@pmatos pmatos commented May 3, 2012

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.

chenyang78 added a commit that referenced this pull request May 3, 2012
Incorrect assignment due to different types
@chenyang78 chenyang78 merged commit 425bc6b into csmith-project:master May 3, 2012
@chenyang78
Copy link
Member

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
[email protected]

Date:
Thu, 3 May 2012 08:13:52 -0700
To:
Eric Eide [email protected]

To:
Eric Eide [email protected]

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:

#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:
#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants