Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Getting 'is not a member of' compiling error while accessing class member in nested class. #19373

Open Quuxplusone opened 10 years ago

Quuxplusone commented 10 years ago
Bugzilla Link PR19374
Status NEW
Importance P normal
Reported by aurelien.ooms@gmail.com
Reported on 2014-04-08 15:42:24 -0700
Last modified on 2014-04-08 15:42:24 -0700
Version 3.2
Hardware PC Linux
CC llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments clangbug.zip (34681 bytes, application/zip)
Blocks
Blocked by
See also
Created attachment 12356
Working example archive.

Working example in attachement file

    # make clean all COMPILER=g++

produces no error while

    # make clean all COMPILER=clang++

outputs

h/pfsp/pivoting/best.hpp:47:20: error: 'pfsp::pivoting::best(const
std::vector<unsigned long, std::allocator<unsigned long> > &, void (*)(const
std::vector<unsigned long, std::allocator<unsigned long> > &,
pfsp::pivoting::functor<std::tuple<unsigned long, unsigned long> > *),
pfsp::eval::functor<int, std::vector<unsigned long, std::allocator<unsigned
long> >, std::tuple<unsigned long, unsigned long>, lib::array::proxy<int>,
std::vector<int, std::allocator<int> > > *)::fn::operator()(const
std::tuple<unsigned long, unsigned long> &)::fn::e' is not a member of class
'fn'

The problem seems to be that in h/pfsp/pivoting/best.hpp:47:20 I don't access
the class members using the this keyword. Adding this-> for all member access
in h/pfsp/pivoting/best.hpp and h/pfsp/pivoting/first.hpp solves the issue but
the program will not compile and strange warnings/errors pop up:
  warning: field 'e' will be initialized after field 'sol' [-Wreorder]
  warning: field 'sol' will be initialized after field 'opt' [-Wreorder]
  warning: field 'opt' will be initialized after field 'argopt' [-Wreorder]
  error: constructor for 'fn' must explicitly initialize the reference member 'sol'

('Strange' because I don't see what's the problem..)

-v
==

g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.1-
10ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-
languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-
4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-
included-gettext --enable-threads=posix --with-gxx-include-
dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --
enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --
enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-
plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-
home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-
root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-
exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-
jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --
disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-
list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-
linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)

clang++ -v
Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
Quuxplusone commented 10 years ago

Attached clangbug.zip (34681 bytes, application/zip): Working example archive.