public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* c++ template conformance: gcc vs MS
@ 2009-05-28  6:12 Mark Tall
  2009-05-28  9:35 ` Mark Tall
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Tall @ 2009-05-28  6:12 UTC (permalink / raw)
  To: gcc

Hello,

I've come across a possible issue with GCC's adherence to the C++
standard for handling template code (gcc version 4.3.2 20081105 from
Fedora 10).

The following code compiles fine under GCC (using -pedantic and
-std=c++98), but fails under Microsoft's C++ 2008 SP1.

Microsoft explains this on
http://msdn.microsoft.com/en-us/library/cx7k7hcf(VS.80).aspx

Is GCC or Microsoft at fault ?


Code (from a header file):

template<typename T1>
struct get_num_type
  { typedef T1 num_type; };

template<>  // this line causes the problem
template<typename T2>
struct get_num_type< std::complex<T2> >
{ typedef T2 num_type; };

MS compilers gives:
error C2910: 'arma::get_pod_type<std::complex<_Other>>' : cannot be
explicitly specialized

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

* Re: c++ template conformance: gcc vs MS
  2009-05-28  6:12 c++ template conformance: gcc vs MS Mark Tall
@ 2009-05-28  9:35 ` Mark Tall
  2009-05-28 10:07   ` Andrew Pinski
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Tall @ 2009-05-28  9:35 UTC (permalink / raw)
  To: gcc

[Sorry, I pasted the wrong compiler output (but for the same bug).
Below is the corrected e-mail. ]

I've come across a possible issue with GCC's adherence to the C++
standard for handling template code (gcc version 4.3.2 20081105 from
Fedora 10).

The following code compiles fine under GCC (using -pedantic and
-std=c++98), but fails under Microsoft's C++ 2008 SP1.

Microsoft explains this on
http://msdn.microsoft.com/en-us/library/cx7k7hcf(VS.80).aspx

Is GCC or Microsoft at fault ?

Code (from a header file):

template<typename T1>
struct get_num_type
 { typedef T1 num_type; };

template<>  // this line causes the problem
template<typename T2>
struct get_num_type< std::complex<T2> >
{ typedef T2 num_type; };

MS compilers gives:
error C2910: 'get_num_type<std::complex<_Other>>' : cannot be
explicitly specialized

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

* Re: c++ template conformance: gcc vs MS
  2009-05-28  9:35 ` Mark Tall
@ 2009-05-28 10:07   ` Andrew Pinski
  2009-05-28 15:45     ` Mark Tall
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Pinski @ 2009-05-28 10:07 UTC (permalink / raw)
  To: Mark Tall; +Cc: gcc

On Wed, May 27, 2009 at 9:56 PM, Mark Tall <mtall.qld@gmail.com> wrote:
> [Sorry, I pasted the wrong compiler output (but for the same bug).
> Below is the corrected e-mail. ]
>
> I've come across a possible issue with GCC's adherence to the C++
> standard for handling template code (gcc version 4.3.2 20081105 from
> Fedora 10).
>
> The following code compiles fine under GCC (using -pedantic and
> -std=c++98), but fails under Microsoft's C++ 2008 SP1.
>
> Microsoft explains this on
> http://msdn.microsoft.com/en-us/library/cx7k7hcf(VS.80).aspx
>
> Is GCC or Microsoft at fault ?

GCC see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24314 .

Thanks,
Andrew Pinski

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

* Re: c++ template conformance: gcc vs MS
  2009-05-28 10:07   ` Andrew Pinski
@ 2009-05-28 15:45     ` Mark Tall
  2009-05-28 16:42       ` Daniel Berlin
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Tall @ 2009-05-28 15:45 UTC (permalink / raw)
  To: gcc

2009/5/28 Andrew Pinski:
>
> GCC see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24314 .
>

hmm.. known since 2005.  Is there some difficulty in fixing this ?

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

* Re: c++ template conformance: gcc vs MS
  2009-05-28 15:45     ` Mark Tall
@ 2009-05-28 16:42       ` Daniel Berlin
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Berlin @ 2009-05-28 16:42 UTC (permalink / raw)
  To: Mark Tall; +Cc: gcc

On Wed, May 27, 2009 at 10:33 PM, Mark Tall <mtall.qld@gmail.com> wrote:
> 2009/5/28 Andrew Pinski:
>>
>> GCC see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24314 .
>>
>
> hmm.. known since 2005.  Is there some difficulty in fixing this ?
>

More likely it's pretty rare so nobody has gotten itchy enough to
scratch that part of the code :)

I'm sure if you wanted to take a gander nobody would stop you :)

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

end of thread, other threads:[~2009-05-28  6:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-28  6:12 c++ template conformance: gcc vs MS Mark Tall
2009-05-28  9:35 ` Mark Tall
2009-05-28 10:07   ` Andrew Pinski
2009-05-28 15:45     ` Mark Tall
2009-05-28 16:42       ` Daniel Berlin

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).