csmith-project/creduce — pull request #1 by pmatos (2012-05-03 15:13:51+00:00)
Title: Incorrect assignment due to different types

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::operator* [with SpecificDecl = clang::FieldDecl, clang::DeclContext::specific_decl_iterator::reference = clang::FieldDecl&]()’
RemoveUnusedStructField.cpp:157:28: note: candidates are:
/localhome/pmatos/local/llvm-githead/include/clang/AST/CanonicalType.h:189:13: note: template bool clang::operator==(clang::CanQual, clang::CanQual

)
/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*.