public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26148] New: g++ bug, possibly introduced around gcc 3.4.0
@ 2006-02-07 2:14 gcc_bugzilla at friedman dot to
2006-02-07 2:24 ` [Bug c++/26148] " pinskia at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: gcc_bugzilla at friedman dot to @ 2006-02-07 2:14 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5085 bytes --]
In the transcript below, the program "problem.C", which does not include any
header files, shows a bug in gcc 3.4.0 under Linux (kernel version 2.6.11)
running on an Intel Pentium 4, which still exists in gcc 4.0.2 but does not
exist in gcc 3.3.2. I also enclose two slightly modified versions of
"problem.C", called "ok1.C" and "ok2.C", which both pass under the newer
compilers.
I have a very large software system in C++ which does not compile on the latest
compiler, and I spent a long time trying to reduce the code to this small
example which I enclose below in "problem.C". Unfortunately, the two
workarounds "ok1.C" and "ok2.C" are not an option in my large system, and any
real workaround would involve either a significant design change or a major
kludge, both of which I would rather avoid, so until I hear from you I cannot
migrate my system over to the latest compiler. Please help!
Sincerely,
Joseph Friedman, Ph.D.
Millennium Partners, L.P.
666 Fifth Avenue, 8th Floor
New York, NY 10103
(212) 841-4160
------------------------------------------------------------------------
% /usr/local/gcc-3.3.2/bin/g++ -v
Reading specs from
/usr/local/gcc-3.3.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs
Configured with: ./configure --prefix=/usr/local/gcc-3.3.2
Thread model: posix
gcc version 3.3.2
% /usr/local/gcc-3.4.0/bin/g++ -v
Reading specs from
/apps/local.linux/gcc-3.4.0/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ./configure --prefix=/usr/local/gcc-3.4.0
Thread model: posix
gcc version 3.4.0
% /usr/local/gcc-4.0.2/bin/g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr/local/gcc-4.0.2
Thread model: posix
gcc version 4.0.2
% /usr/local/gcc-3.3.2/bin/g++ ok1.C
% /usr/local/gcc-3.3.2/bin/g++ ok2.C
% /usr/local/gcc-3.3.2/bin/g++ problem.C
% /usr/local/gcc-3.4.0/bin/g++ ok1.C
% /usr/local/gcc-3.4.0/bin/g++ ok2.C
% /usr/local/gcc-3.4.0/bin/g++ problem.C
problem.C: In constructor `s1<T>::s1(const T&) [with T = pair<double,
double>]':
problem.C:35: instantiated from here
problem.C:14: error: cannot convert `const pair<double, double>' to `double'
for argument `1' to `void ns1::f(double)'
% /usr/local/gcc-4.0.2/bin/g++ ok1.C
% /usr/local/gcc-4.0.2/bin/g++ ok2.C
% /usr/local/gcc-4.0.2/bin/g++ problem.C
problem.C: In constructor s1<T>::s1(const T&) [with T = pair<double,
double>]:
problem.C:35: instantiated from here
problem.C:14: error: cannot convert const pair<double, double> to double
for argument 1 to void ns1::f(double)
% cat problem.C
template<class T1, class T2>
struct pair { pair(T1 x, T2 y) : first(x) {} T1 first; T2 second; };
template<class T1, class T2>
pair<T1, T2> make_pair(T1 x, T2 y) { return pair<T1, T2>(x, y); }
namespace ns1 {
void f(double x) {}
}
template<class T>
struct s1 {
T a;
int i;
s1(const T& x) : a(x) { ns1::f(x); }
};
namespace ns1 {
template<class T> bool f(const pair<T, T>& x) {
f(x.first);
}
}
template<class T>
struct s2 {
typedef pair<T, T> pair_type;
};
template <class S>
struct s3 : public S {
typedef s1<typename S::pair_type> t3;
};
int main() {
pair<double, double> p = make_pair((double)5, (double)12);
s3< s2<double> >::t3 o = s3< s2<double> >::t3(p);
return 0;
}
% cat ok1.C
template<class T1, class T2>
struct pair { pair(T1 x, T2 y) : first(x) {} T1 first; T2 second; };
template<class T1, class T2>
pair<T1, T2> make_pair(T1 x, T2 y) { return pair<T1, T2>(x, y); }
namespace ns1 {
void f(double x) {}
}
namespace ns1 {
template<class T> bool f(const pair<T, T>& x) {
f(x.first);
}
}
template<class T>
struct s1 {
T a;
int i;
s1(const T& x) : a(x) { ns1::f(x); }
};
template<class T>
struct s2 {
typedef pair<T, T> pair_type;
};
template <class S>
struct s3 : public S {
typedef s1<typename S::pair_type> t3;
};
int main() {
pair<double, double> p = make_pair((double)5, (double)12);
s3< s2<double> >::t3 o = s3< s2<double> >::t3(p);
return 0;
}
% cat ok2.C
template<class T1, class T2>
struct pair { pair(T1 x, T2 y) : first(x) {} T1 first; T2 second; };
template<class T1, class T2>
pair<T1, T2> make_pair(T1 x, T2 y) { return pair<T1, T2>(x, y); }
void f(double x) {}
template<class T>
struct s1 {
T a;
int i;
s1(const T& x) : a(x) { f(x); }
};
template<class T> bool f(const pair<T, T>& x) {
f(x.first);
}
template<class T>
struct s2 {
typedef pair<T, T> pair_type;
};
template <class S>
struct s3 : public S {
typedef s1<typename S::pair_type> t3;
};
int main() {
pair<double, double> p = make_pair((double)5, (double)12);
s3< s2<double> >::t3 o = s3< s2<double> >::t3(p);
return 0;
}
--
Summary: g++ bug, possibly introduced around gcc 3.4.0
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcc_bugzilla at friedman dot to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26148
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/26148] g++ bug, possibly introduced around gcc 3.4.0
2006-02-07 2:14 [Bug c++/26148] New: g++ bug, possibly introduced around gcc 3.4.0 gcc_bugzilla at friedman dot to
@ 2006-02-07 2:24 ` pinskia at gcc dot gnu dot org
2006-02-08 17:41 ` gcc_bugzilla at friedman dot to
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-07 2:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-02-07 02:24 -------
This is a dup of bug 11828.
Qualified names are looked up at the point of calling and not looked up at
instantiation time
*** This bug has been marked as a duplicate of 11828 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26148
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/26148] g++ bug, possibly introduced around gcc 3.4.0
2006-02-07 2:14 [Bug c++/26148] New: g++ bug, possibly introduced around gcc 3.4.0 gcc_bugzilla at friedman dot to
2006-02-07 2:24 ` [Bug c++/26148] " pinskia at gcc dot gnu dot org
@ 2006-02-08 17:41 ` gcc_bugzilla at friedman dot to
2006-02-08 17:44 ` pinskia at gcc dot gnu dot org
2006-02-08 22:30 ` gdr at integrable-solutions dot net
3 siblings, 0 replies; 5+ messages in thread
From: gcc_bugzilla at friedman dot to @ 2006-02-08 17:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from gcc_bugzilla at friedman dot to 2006-02-08 17:41 -------
If this conforms with the Committee's decision, then the Committee's decision
is buggy. In my opinion this is clearly a bug because it is inconsistent
between using namespaces and not using namespaces, and GNU should consider
fixing this even if it causes gcc to not be ANSI-compatible.
--
gcc_bugzilla at friedman dot to changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26148
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/26148] g++ bug, possibly introduced around gcc 3.4.0
2006-02-07 2:14 [Bug c++/26148] New: g++ bug, possibly introduced around gcc 3.4.0 gcc_bugzilla at friedman dot to
2006-02-07 2:24 ` [Bug c++/26148] " pinskia at gcc dot gnu dot org
2006-02-08 17:41 ` gcc_bugzilla at friedman dot to
@ 2006-02-08 17:44 ` pinskia at gcc dot gnu dot org
2006-02-08 22:30 ` gdr at integrable-solutions dot net
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-08 17:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-02-08 17:44 -------
Please talk with the standards committee instead of GCC.
try comp.lang.c++ first and then go from there.
g++ tries to strives for being a C++ compiler and not a GNU++ compiler.
*** This bug has been marked as a duplicate of 11828 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26148
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/26148] g++ bug, possibly introduced around gcc 3.4.0
2006-02-07 2:14 [Bug c++/26148] New: g++ bug, possibly introduced around gcc 3.4.0 gcc_bugzilla at friedman dot to
` (2 preceding siblings ...)
2006-02-08 17:44 ` pinskia at gcc dot gnu dot org
@ 2006-02-08 22:30 ` gdr at integrable-solutions dot net
3 siblings, 0 replies; 5+ messages in thread
From: gdr at integrable-solutions dot net @ 2006-02-08 22:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from gdr at integrable-solutions dot net 2006-02-08 22:30 -------
Subject: Re: g++ bug, possibly introduced around gcc 3.4.0
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| try comp.lang.c++ first and then go from there.
comp.std.c++ is the place to talk about ISO C++ definition -- that
is where most ISO C++ standard people look for changes in C++.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26148
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-02-08 22:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-07 2:14 [Bug c++/26148] New: g++ bug, possibly introduced around gcc 3.4.0 gcc_bugzilla at friedman dot to
2006-02-07 2:24 ` [Bug c++/26148] " pinskia at gcc dot gnu dot org
2006-02-08 17:41 ` gcc_bugzilla at friedman dot to
2006-02-08 17:44 ` pinskia at gcc dot gnu dot org
2006-02-08 22:30 ` gdr at integrable-solutions dot net
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).