This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13484] New: Addition of -fenable-msvc-relaxations option


Every time I release my cross-platform C++ based project, I spend 
many hours rewriting little bits of code which compile and work fine on
MSVC7.1 but g++ doesn't like. These tend to fall into two camps:

(i): Use of "typename" in templates to qualify types. If you use one where
g++ doesn't absolutely require it, g++ has major parse errors. MSVC
ignores superfluous typenames (I base this on g++ v3.2).

(ii): Const temporaries. I use temporaries as input a lot, especially to
implement move semantics. Yes I know I should explicitly declare the
temporary as an auto-allocated variable rather than construct in the
parameter list. I also know that non-const copy constructors can cause
problems. However, until that ISO C++ standard addition adding move
constructors is done (ages away), move semantics are painful to implement
when temporaries are const and I'd personally prefer the rope to hang
myself with.

Normally speaking I'd probably keep changing my code, however people are
finding tools based on GCC like GCC-XML more and more useful for
processing MSVC based code - never mind things like Symbian development
being based on both MSVC and GCC. I think there is a real need for this
for certain applications irrespective of the letter of the ISO C++ spec.

Hence can I propose adding an optional switch "-fenable-msvc-
relaxations". I've been trying to identify the const temporary 
creating code in g++ v3.4 CVS but I'm afraid I'm just not familiar 
enough with the code. I know it has something to do with REF_BIND and
convert_like_real() but I haven't quite found where the constness is being
applied. If someone can help out, I'd be glad to make the patch and submit
it.

Cheers,
Niall

-- 
           Summary: Addition of -fenable-msvc-relaxations option
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: s_gccbugzilla at nedprod dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]