public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23896] New: boost::tie() = std::pair doesn't compile
@ 2005-09-15 14:53 Woebbeking at web dot de
2005-09-15 14:54 ` [Bug c++/23896] " Woebbeking at web dot de
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: Woebbeking at web dot de @ 2005-09-15 14:53 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 752 bytes --]
Hi,
with Debian's gcc (version 4.0.2 20050913 (prerelease) (Debian 4.0.1-7)) this
doesn't compile anymore:
const std::pair<int, int> p(1, 2);
int i, j;
boost::tie(i, j) = p;
It works with all older versions and MSVC 7.1.
Cheers,
André
--
Summary: boost::tie() = std::pair doesn't compile
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Woebbeking at web dot de
CC: doko at cs dot tu-berlin dot de,gcc-bugs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
@ 2005-09-15 14:54 ` Woebbeking at web dot de
2005-09-15 15:14 ` [Bug c++/23896] [4.0 Regression] " pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Woebbeking at web dot de @ 2005-09-15 14:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Woebbeking at web dot de 2005-09-15 14:54 -------
Created an attachment (id=9735)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9735&action=view)
example code, save-temps and compiler error message
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
2005-09-15 14:54 ` [Bug c++/23896] " Woebbeking at web dot de
@ 2005-09-15 15:14 ` pinskia at gcc dot gnu dot org
2005-09-15 15:15 ` [Bug c++/23896] [4.0/4.1 " pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-15 15:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-15 15:14 -------
Even after the fix for PR 23691, this still fails. It worked with "4.0.2 20050826".
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Known to fail| |4.0.2
Known to work| |4.0.0
Summary|boost::tie() = std::pair |[4.0 Regression]
|doesn't compile |boost::tie() = std::pair
| |doesn't compile
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
2005-09-15 14:54 ` [Bug c++/23896] " Woebbeking at web dot de
2005-09-15 15:14 ` [Bug c++/23896] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2005-09-15 15:15 ` pinskia at gcc dot gnu dot org
2005-09-15 15:21 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-15 15:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-15 15:15 -------
It also fails with "4.1.0 20050903".
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.0 Regression] |[4.0/4.1 Regression]
|boost::tie() = std::pair |boost::tie() = std::pair
|doesn't compile |doesn't compile
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (2 preceding siblings ...)
2005-09-15 15:15 ` [Bug c++/23896] [4.0/4.1 " pinskia at gcc dot gnu dot org
@ 2005-09-15 15:21 ` pinskia at gcc dot gnu dot org
2005-09-15 15:28 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-15 15:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-15 15:21 -------
Reducing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (3 preceding siblings ...)
2005-09-15 15:21 ` pinskia at gcc dot gnu dot org
@ 2005-09-15 15:28 ` pinskia at gcc dot gnu dot org
2005-09-15 15:48 ` debian-gcc at lists dot debian dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-15 15:28 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (4 preceding siblings ...)
2005-09-15 15:28 ` pinskia at gcc dot gnu dot org
@ 2005-09-15 15:48 ` debian-gcc at lists dot debian dot org
2005-09-15 16:22 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2005-09-15 15:48 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC|doko at cs dot tu-berlin dot|debian-gcc at lists dot
|de |debian dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (5 preceding siblings ...)
2005-09-15 15:48 ` debian-gcc at lists dot debian dot org
@ 2005-09-15 16:22 ` pinskia at gcc dot gnu dot org
2005-09-15 17:56 ` bangerth at dealii dot org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-15 16:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-15 16:22 -------
Reduced as far as I could do:
namespace boost{
template <bool x> struct STATIC_ASSERTION_FAILURE {};
struct null_type;
template <class T0 = null_type, class T1 = null_type, class T2 = null_type> class tuple;
template <class TT> struct cons {
typedef TT tail_type;
};
template<class T> struct length {
static const int value = 1 + length<typename T::tail_type>::value;
};
template<> struct length<null_type> {
static const int value = 0;
};
namespace detail {
template <class T0, class T1, class T2> struct map_tuple_to_cons {
typedef cons<typename map_tuple_to_cons<T1, T2, null_type>::type > type;
};
template <> struct map_tuple_to_cons<null_type, null_type, null_type> {
typedef null_type type;
};
}
template <class T0, class T1, class T2> struct tuple : detail::map_tuple_to_cons<T0, T1, T2>::type
{
tuple& operator=(int t1) {
int t = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( length<tuple>::value == 2 ) >);
}
};
}
int main() {
boost::tuple<int&, int&> a;
a = 1;
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-09-15 16:22:23
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (6 preceding siblings ...)
2005-09-15 16:22 ` pinskia at gcc dot gnu dot org
@ 2005-09-15 17:56 ` bangerth at dealii dot org
2005-09-15 18:05 ` mmitchel at gcc dot gnu dot org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bangerth at dealii dot org @ 2005-09-15 17:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2005-09-15 17:56 -------
This is what I come up with:
-------------------
template <int> struct X {};
template <typename T> struct length {
static const int value = 2;
};
template <typename T> void foo () {
sizeof(X<length<T>::value>);
}
template void foo<int>();
-----------------------------
g/x> /home/bangerth/bin/gcc-3.4*-pre/bin/c++ -c x.cc
g/x> /home/bangerth/bin/gcc-4.0*-pre/bin/c++ -c x.cc
x.cc: In function ‘void foo() [with T = int]’:
x.cc:11: instantiated from here
x.cc:8: error: ‘length<int>::value’ is not a valid template argument for type
‘int’ because it is a non-constant expression
g/x> /home/bangerth/bin/gcc-4.1*-pre/bin/c++ -c x.cc
x.cc: In function ‘void foo() [with T = int]’:
x.cc:11: instantiated from here
x.cc:8: error: ‘length<int>::value’ is not a valid template argument for type
‘int’ because it is a non-constant expression
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (7 preceding siblings ...)
2005-09-15 17:56 ` bangerth at dealii dot org
@ 2005-09-15 18:05 ` mmitchel at gcc dot gnu dot org
2005-09-16 1:51 ` cvs-commit at gcc dot gnu dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-15 18:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-09-15 18:05 -------
Darn, I should never have fixed that original PR. Silly me, trying to fix bugs.
Mine.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |mark at codesourcery dot com
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (8 preceding siblings ...)
2005-09-15 18:05 ` mmitchel at gcc dot gnu dot org
@ 2005-09-16 1:51 ` cvs-commit at gcc dot gnu dot org
2005-09-16 1:55 ` mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-16 1:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-16 01:51 -------
Subject: Bug 23896
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2005-09-16 01:50:26
Modified files:
gcc/cp : ChangeLog pt.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/template: static17.C
Log message:
PR c++/23896
* pt.c (tsubst_aggr_type): Make sure skip_evaluation is false when
processing template arguments.
PR c++/23896
* g++.dg/template/static17.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4893&r2=1.4894
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.1036&r2=1.1037
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6068&r2=1.6069
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static17.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (9 preceding siblings ...)
2005-09-16 1:51 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-16 1:55 ` mmitchel at gcc dot gnu dot org
2005-09-16 1:56 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-16 1:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-09-16 01:54 -------
Fixed in 4.0.2.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (10 preceding siblings ...)
2005-09-16 1:55 ` mmitchel at gcc dot gnu dot org
@ 2005-09-16 1:56 ` cvs-commit at gcc dot gnu dot org
2005-09-17 8:30 ` Woebbeking at web dot de
2005-09-20 17:22 ` Woebbeking at web dot de
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-16 1:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-16 01:54 -------
Subject: Bug 23896
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: mmitchel@gcc.gnu.org 2005-09-16 01:53:43
Modified files:
gcc/cp : ChangeLog pt.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/template: static17.C
Log message:
PR c++/23896
* pt.c (tsubst_aggr_type): Make sure skip_evaluation is false when
processing template arguments.
PR c++/23896
* g++.dg/template/static17.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.104&r2=1.4648.2.105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.978.2.25&r2=1.978.2.26
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.406&r2=1.5084.2.407
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static17.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (11 preceding siblings ...)
2005-09-16 1:56 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-17 8:30 ` Woebbeking at web dot de
2005-09-20 17:22 ` Woebbeking at web dot de
13 siblings, 0 replies; 15+ messages in thread
From: Woebbeking at web dot de @ 2005-09-17 8:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Woebbeking at web dot de 2005-09-17 08:30 -------
Wow, that was fast, thanks. I'll give it a try with the next Debian package.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
` (12 preceding siblings ...)
2005-09-17 8:30 ` Woebbeking at web dot de
@ 2005-09-20 17:22 ` Woebbeking at web dot de
13 siblings, 0 replies; 15+ messages in thread
From: Woebbeking at web dot de @ 2005-09-20 17:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Woebbeking at web dot de 2005-09-20 17:21 -------
Works for me. I hope VERIFIED is the same as CLOSED.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |VERIFIED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23896
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2005-09-20 17:22 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-15 14:53 [Bug c++/23896] New: boost::tie() = std::pair doesn't compile Woebbeking at web dot de
2005-09-15 14:54 ` [Bug c++/23896] " Woebbeking at web dot de
2005-09-15 15:14 ` [Bug c++/23896] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-09-15 15:15 ` [Bug c++/23896] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-09-15 15:21 ` pinskia at gcc dot gnu dot org
2005-09-15 15:28 ` pinskia at gcc dot gnu dot org
2005-09-15 15:48 ` debian-gcc at lists dot debian dot org
2005-09-15 16:22 ` pinskia at gcc dot gnu dot org
2005-09-15 17:56 ` bangerth at dealii dot org
2005-09-15 18:05 ` mmitchel at gcc dot gnu dot org
2005-09-16 1:51 ` cvs-commit at gcc dot gnu dot org
2005-09-16 1:55 ` mmitchel at gcc dot gnu dot org
2005-09-16 1:56 ` cvs-commit at gcc dot gnu dot org
2005-09-17 8:30 ` Woebbeking at web dot de
2005-09-20 17:22 ` Woebbeking at web dot de
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).