public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Possible bug in compiler ?
@ 2006-11-02 13:21 Jasz Zoltan
  0 siblings, 0 replies; only message in thread
From: Jasz Zoltan @ 2006-11-02 13:21 UTC (permalink / raw)
  To: gcc-help

Hi,
 
We've encountered a problem using g++ compiler version
4.1.2 (that was the latest we downloaded). Seems like
a bug but, we are not shore. We didn't find any
related problem in the mailing list.
Here is a simplified code that causes the problem:

/////////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
template <typename T, int v> class record_descriptor
{
public:
    void operator()()
    {
        printf("Global template\n");
    }
};
template<typename T, int v, template<typename,int>
class RD = record_descriptor> class TableRecord
{
public:
    TableRecord()
    {
        RD<T, v> d;
        d();
    }
};
template<typename A> class Attr
{
public:
    template <typename T, int v> class
i_record_descriptor
    {
    public:
        void operator()()
        {
            printf("Inner template\n");
        }
    };
    template <int v> class i_record_descriptor<A, v>
    {
    public:
        void operator()()
        {
            printf("Inner spec template\n");
        }
    };
    Attr()
    {
        TableRecord<A, 1, i_record_descriptor> tr;
    }
};
int main()
{
    Attr<int> attr;
    return 0;
}
/////////////////////////////////////////////////////////////////////////////////
It compiles fine, but the result after running the
executable is "Inner template" instead of "Inner spec
template".

Can somebody help us to find out what is wrong?

The compiler's exact version is:
g++ (GCC) 4.1.2 20060901 (prerelease) (Debian
4.1.1-13)


Thanks in advance!

Zoltan.



 
____________________________________________________________________________________
We have the perfect Group for you. Check out the handy changes to Yahoo! Groups 
(http://groups.yahoo.com)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-02 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-02 13:21 Possible bug in compiler ? Jasz Zoltan

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