help-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug c++/14534] New: Unrecognizing static function as a template paramet


From: sato at geoft dot ru
Subject: [Bug c++/14534] New: Unrecognizing static function as a template parameter when its return value is also templated
Date: 11 Mar 2004 13:08:17 -0000

avr-gcc.EXE (GCC) 3.3.1

Reading specs from C:\WinAVR\bin\..\lib\gcc-lib\avr\3.3.1\specs
Configured with: ../configure --prefix=/e/avrdev/install --target=avr --enable-
languages=c,c++ --disable-nls --enable-win32-registry=WinAVR
Thread model: single
gcc version 3.3.1

mingw32-gcc.EXE (GCC) 3.2 (mingw special 20020817-1)

Reading specs from c:/mingw/bin/../lib/gcc-lib/mingw32/3.2/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --
host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --
enable-languages=f77,c++,objc,ada --disable-win32-registry --disable-shared
Thread model: win32
gcc version 3.2 (mingw special 20020817-1)

> avr-gcc test.cpp
test.cpp:10: error: invalid use of undefined type `class Boo'
test.cpp:6: error: forward declaration of `class Boo'
test.cpp:10: error: template argument 2 is invalid
test.cpp:10: error: ISO C++ forbids declaration of `far_type' with no type

test.cpp: -------------------------

template <class Val, Val func()>
class Far {};

class Boo
{
public:
        static int some();

        typedef Far<int, some> far_type; // error
};

int main()
{
}
----------------------------------

BUT this file will be compiled successfully

test.cpp: -------------------------

template <class Val, Val func()>
class Far {};

class Boo
{
public:
        static int some();

        typedef Far<int, Boo::some> far_type; // ok (explicit scope specifier)
};

int main()
{
}
----------------------------------

-- 
           Summary: Unrecognizing static function as a template parameter
                    when its return value is also templated
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sato at geoft dot ru
                CC: gcc-bugs at gcc dot gnu dot org


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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]