Hide Forgot
Description of problem: [ 67%] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/BitTracker.cpp.o /home/vedranm/workspace/llvm/lib/Target/Hexagon/BitTracker.cpp:87:70: error: ‘llvm::raw_ostream& llvm::operator<<(llvm::raw_ostream&, const llvm::BitTracker::BitValue&)’ should have been declared inside ‘llvm’ raw_ostream &llvm::operator<<(raw_ostream &OS, const BT::BitValue &BV) { ^ /home/vedranm/workspace/llvm/lib/Target/Hexagon/BitTracker.cpp:105:74: error: ‘llvm::raw_ostream& llvm::operator<<(llvm::raw_ostream&, const llvm::BitTracker::RegisterCell&)’ should have been declared inside ‘llvm’ raw_ostream &llvm::operator<<(raw_ostream &OS, const BT::RegisterCell &RC) { ^ lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/build.make:62: recipe for target 'lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/BitTracker.cpp.o' failed make[2]: *** [lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/BitTracker.cpp.o] Error 1 CMakeFiles/Makefile2:6611: recipe for target 'lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/all' failed make[1]: *** [lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2 Version-Release number of selected component (if applicable): 6.0.0-0.11.fc24 How reproducible: Every time. Steps to Reproduce: Clone LLVM from Git and try to build it. Additional info: 6.0.0-0.10.fc24 does not have the same problem.
Please attach preprocessed source (e.g. use -save-temps) and g++ options used to compile it.
Created attachment 1127388 [details] File resulting from -save-temps Full command: /usr/bin/g++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/vedranm/workspace/llvm/another-build/lib/Target/Hexagon -I/home/vedranm/workspace/llvm/lib/Target/Hexagon -I/home/vedranm/workspace/llvm/another-build/include -I/home/vedranm/workspace/llvm/include -save-temps -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -fPIC -fno-exceptions -fno-rtti -o CMakeFiles/LLVMHexagonCodeGen.dir/BitTracker.cpp.o -c /home/vedranm/workspace/llvm/lib/Target/Hexagon/BitTracker.cpp
Oh, and thanks for the insanely fast reply.
We reject this since commit ce20a5bdb5a7f81bb974210ae75bdde5913f60b1 Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed Feb 10 15:34:59 2016 +0000 PR c++/69657 * name-lookup.c (ambiguous_decl): Call remove_hidden_names. (lookup_name_real_1): Likewise. (remove_hidden_names): Handle non-functions too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233278 138bc75d-0d04-0410-961f-82ee72b054a4
OK, thanks for the information. I submitted a fix to LLVM: http://reviews.llvm.org/D17281
Reduced: namespace llvm { struct A { struct B; struct C; friend int &operator<<(int &, const B &); friend int operator<<(int, C); }; } int &llvm::operator<<(int &, const A::B &);
I got namespace llvm { class A; void operator<<(int, A); struct B { struct C; friend int &operator<<(int &, const C &); }; } int &llvm::operator<<(int &, const llvm::B::C &); Anyway, if it is ok these testcases are rejected, perhaps we should add them to gcc testsuite.
I've checked in a patch lowering the error to a pedwarn.