public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/49386] New: #undef min/max is dependent on order if #include
@ 2011-06-13  7:23 gintensubaru at gmail dot com
  2011-06-13  7:55 ` [Bug libstdc++/49386] " chris at bubblescope dot net
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: gintensubaru at gmail dot com @ 2011-06-13  7:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49386

           Summary: #undef min/max is dependent on order if #include
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gintensubaru@gmail.com


testsuite ( bug.cc ) :

#include <iostream> // any C++ header not including <algorithm>

#define max( a, b ) bad_macro
#include <algorithm>


output:

In file included from
/usr/local/gcc47-20110604/lib/gcc/i686-pc-cygwin/4.7.0/../../../../include/c++/4.7.0/bits/stl_algo.h:62:0,
                 from
/usr/local/gcc47-20110604/lib/gcc/i686-pc-cygwin/4.7.0/../../../../include/c++/4.7.0/algorithm:63,
                 from bug.cc:4:
/usr/local/gcc47-20110604/lib/gcc/i686-pc-cygwin/4.7.0/../../../../include/c++/4.7.0/bits/algorithmfwd.h:358:41:
error: macro "max" passed 3 arguments, but takes just 2
/usr/local/gcc47-20110604/lib/gcc/i686-pc-cygwin/4.7.0/../../../../include/c++/4.7.0/bits/algorithmfwd.h:354:5:
error: template declaration of 'const _Tp& std::bad_macro'
/usr/local/gcc47-20110604/lib/gcc/i686-pc-cygwin/4.7.0/../../../../include/c++/4.7.0/bits/algorithmfwd.h:358:5:
error: template declaration of 'const _Tp& std::max'


note:

The same error occurs in case of including <limits>.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-01-04 10:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-13  7:23 [Bug libstdc++/49386] New: #undef min/max is dependent on order if #include gintensubaru at gmail dot com
2011-06-13  7:55 ` [Bug libstdc++/49386] " chris at bubblescope dot net
2011-06-13  8:09 ` gintensubaru at gmail dot com
2011-06-13  8:16 ` chris at bubblescope dot net
2011-06-13  8:29 ` gintensubaru at gmail dot com
2011-06-13  9:26 ` paolo.carlini at oracle dot com
2011-06-13  9:29 ` paolo.carlini at oracle dot com
2011-06-13  9:35 ` paolo.carlini at oracle dot com
2011-06-13  9:44 ` paolo.carlini at oracle dot com
2011-06-13 10:58 ` jakub at gcc dot gnu.org
2011-06-13 11:37 ` paolo.carlini at oracle dot com
2011-06-13 11:55 ` paolo.carlini at oracle dot com
2011-06-26 22:40 ` paolo.carlini at oracle dot com
2012-01-04 10:11 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).