* [devel] parse error in template argument list
@ 2006-12-08 14:38 Slava Dubrovskiy
2006-12-08 14:50 ` Denis Kirienko
2006-12-08 15:11 ` Sergey Vlasov
0 siblings, 2 replies; 4+ messages in thread
From: Slava Dubrovskiy @ 2006-12-08 14:38 UTC (permalink / raw)
To: Devel
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
Здравствуйте.
Наткнулся на такую ситуацию при сборке firebird. Вот пример:
$cat test.cpp
#include <sys/types.h>
template <typename Object, size_t Capacity = 16>
class Stack
{
private:
void* stk;
void* stk_cache;
public:
explicit Stack<Object, Capacity>()
: stk(0), stk_cache(0) { }
Stack<Object, Capacity>()
: stk(0), stk_cache(0) { }
~Stack<Object, Capacity>()
{
delete stk;
delete stk_cache;
}
}; // class Stack
int main(int argc, char* argv)
{
return(0);
}
$ g++-3.4 -o test test.cpp
$ g++-4.1 -o test test.cpp
test.cpp:17: error: parse error in template argument list
$ rpm -qa | grep gcc
gccmakedep-1.0.1-alt1
gcc4.1-doc-4.1.1-alt10
gcc-c++-common-1.4.10-alt1
gcc3.4-3.4.5-alt6
gcc-common-1.4.10-alt1
gcc3.4-c++-3.4.5-alt6
libgcc4.1-4.1.1-alt10
gcc4.1-c++-4.1.1-alt10
gcc4.1-4.1.1-alt10
Вопрос: как с этим бороться? Использовать для сборки 3.4?
--
WBR,
Dubrovskiy Vyacheslav
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] parse error in template argument list
2006-12-08 14:38 [devel] parse error in template argument list Slava Dubrovskiy
@ 2006-12-08 14:50 ` Denis Kirienko
2006-12-08 15:11 ` Sergey Vlasov
1 sibling, 0 replies; 4+ messages in thread
From: Denis Kirienko @ 2006-12-08 14:50 UTC (permalink / raw)
To: ALT Devel discussion list
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
Slava Dubrovskiy пишет:
> $ g++-3.4 -o test test.cpp
> $ g++-4.1 -o test test.cpp
> test.cpp:17: error: parse error in template argument list
> Вопрос: как с этим бороться? Использовать для сборки 3.4?
Сдается мне, что вместо
> ~Stack<Object, Capacity>()
должно быть просто
~Stack()
--
Денис
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] parse error in template argument list
2006-12-08 14:38 [devel] parse error in template argument list Slava Dubrovskiy
2006-12-08 14:50 ` Denis Kirienko
@ 2006-12-08 15:11 ` Sergey Vlasov
2006-12-08 15:46 ` Slava Dubrovskiy
1 sibling, 1 reply; 4+ messages in thread
From: Sergey Vlasov @ 2006-12-08 15:11 UTC (permalink / raw)
To: Devel
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
On Fri, Dec 08, 2006 at 04:38:54PM +0200, Slava Dubrovskiy wrote:
> Наткнулся на такую ситуацию при сборке firebird. Вот пример:
>
> $cat test.cpp
>
> #include <sys/types.h>
>
> template <typename Object, size_t Capacity = 16>
> class Stack
> {
> private:
> void* stk;
> void* stk_cache;
>
> public:
> explicit Stack<Object, Capacity>()
> : stk(0), stk_cache(0) { }
>
> Stack<Object, Capacity>()
> : stk(0), stk_cache(0) { }
>
> ~Stack<Object, Capacity>()
А если тут везде написать вместо Stack<Object, Capacity> просто Stack (без
явного указания параметров)?
> {
> delete stk;
> delete stk_cache;
> }
> }; // class Stack
>
> int main(int argc, char* argv)
> {
> return(0);
> }
>
> $ g++-3.4 -o test test.cpp
> $ g++-4.1 -o test test.cpp
> test.cpp:17: error: parse error in template argument list
>
> $ rpm -qa | grep gcc
> gccmakedep-1.0.1-alt1
> gcc4.1-doc-4.1.1-alt10
> gcc-c++-common-1.4.10-alt1
> gcc3.4-3.4.5-alt6
> gcc-common-1.4.10-alt1
> gcc3.4-c++-3.4.5-alt6
> libgcc4.1-4.1.1-alt10
> gcc4.1-c++-4.1.1-alt10
> gcc4.1-4.1.1-alt10
А 4.1.1-alt9 собирает и в таком виде...
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] parse error in template argument list
2006-12-08 15:11 ` Sergey Vlasov
@ 2006-12-08 15:46 ` Slava Dubrovskiy
0 siblings, 0 replies; 4+ messages in thread
From: Slava Dubrovskiy @ 2006-12-08 15:46 UTC (permalink / raw)
To: ALT Devel discussion list
[-- Attachment #1: Type: text/plain, Size: 145 bytes --]
Sergey Vlasov пишет:
> А 4.1.1-alt9 собирает и в таком виде...
>
А я же к чему и веду. Что такого случилось?
--
WBR,
Dubrovskiy Vyacheslav
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-12-08 15:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-08 14:38 [devel] parse error in template argument list Slava Dubrovskiy
2006-12-08 14:50 ` Denis Kirienko
2006-12-08 15:11 ` Sergey Vlasov
2006-12-08 15:46 ` Slava Dubrovskiy
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git