[LLVMbugs] [Bug 9906] New: Clang incorrectly fails to detect nested struct in class definition with Boost.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu May 12 09:03:07 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=9906
Summary: Clang incorrectly fails to detect nested struct in
class definition with Boost.
Product: clang
Version: 2.9
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: jon at funkitron.com
CC: llvmbugs at cs.uiuc.edu
Overview:
In a program which #includes boost's Trim algorithm, if both the boost and
std namespace are brought into the global namespace with a "using" declaration,
the compiler will improperly fail to detect an internal struct of a class named
"iterator".
Steps to Reproduce (Note: There may be simpler steps to reproduce):
1. Create a new command line program project in xcode 4.0.2.
2. Change program text to:
#include <boost/algorithm/string/trim.hpp>
using namespace std;
using namespace boost;
class Test {
struct iterator {
};
friend struct Test::iterator;
};
int main (int argc, const char * argv[])
{
return 0;
}
3. Install Boost 1.41
4. Add reference to Boost 1.41 to project's header referenes.
Actual Results:
/Compiler Breaker/Compiler Breaker/Compiler
Breaker/main.cpp:19:25:{19:19-19:25}: error: no struct named 'iterator' in
'Test' [2]
Expected Results: Program should compile normally.
Build Date & Platform:
clang --version
Apple clang version 2.0 (tags/Apple/clang-139) (based on LLVM 2.9svn)
Target: x86_64-apple-darwin10
Thread model: posix
Additional Information:
Removing either Using Namespace tag will cause the error to go away.
Renaming the struct from "iterator" to "notiterator" will cause the error to go
away.
Program compiles without objection in LLVM GCC 4.2. A much more complicated
version of the program compiled successfully in visual studios 2005.
There is a struct iterator class added to the boost namespace in
boost/iterator.hpp line 55.
There is a struct iterator class added to the std namespace in
stl_iterator_base_types.h in the mac os 10.6 sdk.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list