[lexical_cast][random] ADL problem with gcc c++11

Hi, I can't get this to compile on gcc-4.6.1 with -std=c++0x flag: #include <boost/random.hpp> int main() { return 0; } I'm getting an error in lexical_cast: C:\dev\boost/boost/lexical_cast.hpp:1323:120: error: there are no arguments to 'swprintf' that depend on a template parameter, so a declaration of 'swprintf' must be available [-fpermissive] Obviously, I can compile with -fpermissive, but I'd like to report this anyway. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

2012/3/19 Joel de Guzman <joel@boost-consulting.com>:
Hi,
I can't get this to compile on gcc-4.6.1 with -std=c++0x flag:
#include <boost/random.hpp>
int main() { return 0; }
I'm getting an error in lexical_cast:
Could not reproduce it with trunk version and gcc-4.6.1-9ubuntu3. Which version of boost are you using? -- Best regards, Antony Polukhin

On 3/20/2012 1:27 AM, Antony Polukhin wrote:
2012/3/19 Joel de Guzman <joel@boost-consulting.com>:
Hi,
I can't get this to compile on gcc-4.6.1 with -std=c++0x flag:
#include <boost/random.hpp>
int main() { return 0; }
I'm getting an error in lexical_cast:
Could not reproduce it with trunk version and gcc-4.6.1-9ubuntu3. Which version of boost are you using?
I tested both trunk and release branches + the 1.49.0 release. All fail. I'm on Windows using gcc-4.6.1 mingw. I typically test using BJam. I also test using the gcc compiler directly with these flags: -Wall -mconsole -ftemplate-depth-512 -DNDEBUG -DNDEBUG -O3 -finline-functions -funroll-loops -Wfatal-errors -std=c++0x -static-libgcc -static-libstdc++ ========================================================================== Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/dev/tools/mingw/bin/../libexec/gcc/mingw32/ 4.6.1/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.1/configure --enable-languages=c,c++, fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.1 (GCC) ========================================================================== Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

On Mar 19, 2012, at 4:00 PM, Joel de Guzman wrote:
On 3/20/2012 1:27 AM, Antony Polukhin wrote:
2012/3/19 Joel de Guzman <joel@boost-consulting.com>:
Hi,
I can't get this to compile on gcc-4.6.1 with -std=c++0x flag:
#include <boost/random.hpp>
int main() { return 0; }
I'm getting an error in lexical_cast:
Could not reproduce it with trunk version and gcc-4.6.1-9ubuntu3. Which version of boost are you using?
I tested both trunk and release branches + the 1.49.0 release. All fail.
I'm on Windows using gcc-4.6.1 mingw. I typically test using BJam. I also test using the gcc compiler directly with these flags:
-Wall -mconsole -ftemplate-depth-512 -DNDEBUG -DNDEBUG -O3 -finline-functions -funroll-loops -Wfatal-errors -std=c++0x -static-libgcc -static-libstdc++
========================================================================== Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/dev/tools/mingw/bin/../libexec/gcc/mingw32/ 4.6.1/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.1/configure --enable-languages=c,c++, fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.1 (GCC) ==========================================================================
Very strange. I pasted your code into a file, and tried it on my Mac. I used trunk and release branches, gcc 4.2.1 and clang (from svn). All succeeded. Sample command: $ clang++ -I /Volumes/EyeFive/Marshall/Sources/boost/release junk.cpp $ -- Marshall

On Tue, Mar 20, 2012 at 12:22 AM, Marshall Clow <mclow.lists@gmail.com> wrote:
Very strange. I pasted your code into a file, and tried it on my Mac. I used trunk and release branches, gcc 4.2.1 and clang (from svn).
All succeeded.
Looks like it's a known and mingw specific issue. https://svn.boost.org/trac/boost/ticket/6252 -- Olaf

2012/3/20 Olaf van der Spek <ml@vdspek.org>:
On Tue, Mar 20, 2012 at 12:22 AM, Marshall Clow <mclow.lists@gmail.com> wrote:
Very strange. I pasted your code into a file, and tried it on my Mac. I used trunk and release branches, gcc 4.2.1 and clang (from svn).
All succeeded.
Looks like it's a known and mingw specific issue.
Created ticket #6717. I'll fix it after dealing with iterator_range<> optimizations. -- Best regards, Antony Polukhin

On 20/03/12 00:22, Marshall Clow wrote:
Very strange. I pasted your code into a file, and tried it on my Mac. I used trunk and release branches, gcc 4.2.1 and clang (from svn).
The bug only appears when the compiler is very strict about name lookups in template contexts. GCC 4.6+ is stricter than 4.2. This particular bug is a missing include, which may be windows-specific.

On Mar 25, 2012, at 6:25 AM, Mathias Gaunard wrote:
On 20/03/12 00:22, Marshall Clow wrote:
Very strange. I pasted your code into a file, and tried it on my Mac. I used trunk and release branches, gcc 4.2.1 and clang (from svn).
The bug only appears when the compiler is very strict about name lookups in template contexts.
GCC 4.6+ is stricter than 4.2.
Yes, and clang is (usually) stricter than gcc.
This particular bug is a missing include, which may be windows-specific.
That would explain why I didn't see it. -- Marshall Marshall Clow Idio Software <mailto:mclow.lists@gmail.com> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
participants (5)
-
Antony Polukhin
-
Joel de Guzman
-
Marshall Clow
-
Mathias Gaunard
-
Olaf van der Spek