public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52485] New: [c++11] add an option to disable c++11 user-defined literals
@ 2012-03-04 20:58 eu at doxos dot eu
  2012-03-04 22:56 ` [Bug c++/52485] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: eu at doxos dot eu @ 2012-03-04 20:58 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52485
           Summary: [c++11] add an option to disable c++11 user-defined
                    literals
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eu@doxos.eu


Some upstream code (e.g. #50917 for Mozilla, I have issues with Qt4's SLOT(...)
macros) is broken because of the support for c++11 literals in 4.7. In all
cases I've seen the cause was missing space between constructs like #define
FOO(a) "0"#a.

Sine this feature is little used, but lot of code, it would be reasonable to
provide a switch to disable user-defined literals, so that code which needs
c++11 but at the same time links to (technically broken) libs can be compiled,
until those libs get fixed upstream.


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

* [Bug c++/52485] [c++11] add an option to disable c++11 user-defined literals
  2012-03-04 20:58 [Bug c++/52485] New: [c++11] add an option to disable c++11 user-defined literals eu at doxos dot eu
@ 2012-03-04 22:56 ` pinskia at gcc dot gnu.org
  2012-03-05  8:55 ` eu at doxos dot eu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-03-04 22:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-04 22:56:18 UTC ---
I think we should not have an option to disable user-defined literals at all. 
Since their code is not C++11, they should fix their code to be C++11 if they
use the -std=c++11/-std++0x option.


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

* [Bug c++/52485] [c++11] add an option to disable c++11 user-defined literals
  2012-03-04 20:58 [Bug c++/52485] New: [c++11] add an option to disable c++11 user-defined literals eu at doxos dot eu
  2012-03-04 22:56 ` [Bug c++/52485] " pinskia at gcc dot gnu.org
@ 2012-03-05  8:55 ` eu at doxos dot eu
  2012-03-05  9:07 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: eu at doxos dot eu @ 2012-03-05  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Václav Šmilauer <eu at doxos dot eu> 2012-03-05 08:55:12 UTC ---
(In reply to comment #1)
> I think we should not have an option to disable user-defined literals at all. 
> Since their code is not C++11, they should fix their code to be C++11 if they
> use the -std=c++11/-std++0x option.

You were right in an ideal world. OTOH it is a point where c++11 breaks
backward-compatibility with legal c++03 code; therefore, as an interim solution
before "they" fix "their" code (think how long does it take before Qt fixes
their code and the fixes come downstream? A year?), optinally disabling this
feature would be useful.

The fix is always putting some extra spaces in macro definitions; it can (will)
be hacked around on a case-by-case basis and that is ugly.


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

* [Bug c++/52485] [c++11] add an option to disable c++11 user-defined literals
  2012-03-04 20:58 [Bug c++/52485] New: [c++11] add an option to disable c++11 user-defined literals eu at doxos dot eu
  2012-03-04 22:56 ` [Bug c++/52485] " pinskia at gcc dot gnu.org
  2012-03-05  8:55 ` eu at doxos dot eu
@ 2012-03-05  9:07 ` jakub at gcc dot gnu.org
  2012-03-05  9:20 ` eu at doxos dot eu
  2012-11-12 15:00 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-05  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-05 09:07:21 UTC ---
That is not ugly, that is the right thing to do.  Every GCC version has some
changes that require changes in lots of application sources (see
http://gcc.gnu.org/gcc-4.N/porting_to.html for various N), this is just one of
them, documented and fairly trivial to discover and fix.  If you don't have a
C++11 source, don't compile with -std=c++11.


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

* [Bug c++/52485] [c++11] add an option to disable c++11 user-defined literals
  2012-03-04 20:58 [Bug c++/52485] New: [c++11] add an option to disable c++11 user-defined literals eu at doxos dot eu
                   ` (2 preceding siblings ...)
  2012-03-05  9:07 ` jakub at gcc dot gnu.org
@ 2012-03-05  9:20 ` eu at doxos dot eu
  2012-11-12 15:00 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: eu at doxos dot eu @ 2012-03-05  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Václav Šmilauer <eu at doxos dot eu> 2012-03-05 09:20:26 UTC ---
I think you understood my source _is_ c++11, but the libs I have to use are
not; therefore I have to compile with -std=c++11. The the fix is admittedly
trivial and documented, but consists in editing 3rd-party headers. It is ugly
and right at the same time.

Close this bug if it has no chance.


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

* [Bug c++/52485] [c++11] add an option to disable c++11 user-defined literals
  2012-03-04 20:58 [Bug c++/52485] New: [c++11] add an option to disable c++11 user-defined literals eu at doxos dot eu
                   ` (3 preceding siblings ...)
  2012-03-05  9:20 ` eu at doxos dot eu
@ 2012-11-12 15:00 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-11-12 15:00 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-12 14:59:40 UTC ---
Closing.


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

end of thread, other threads:[~2012-11-12 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-04 20:58 [Bug c++/52485] New: [c++11] add an option to disable c++11 user-defined literals eu at doxos dot eu
2012-03-04 22:56 ` [Bug c++/52485] " pinskia at gcc dot gnu.org
2012-03-05  8:55 ` eu at doxos dot eu
2012-03-05  9:07 ` jakub at gcc dot gnu.org
2012-03-05  9:20 ` eu at doxos dot eu
2012-11-12 15:00 ` 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).