This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12635] New: wrong interpretation of typename with constructor delimiters
- From: "numerical dot simulation at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Oct 2003 09:24:43 -0000
- Subject: [Bug c++/12635] New: wrong interpretation of typename with constructor delimiters
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12635
Summary: wrong interpretation of typename with constructor
delimiters
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: numerical dot simulation at web dot de
CC: gcc-bugs at gcc dot gnu dot org,numerical dot simulation
at web dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
g++ (GCC) 3.4 20031015 rejects this IMHO perfectly valid code:
template <typename T> struct Expr {};
struct Some;
// workaround some early diagnostics (incomplete type problem) below
template<typename, typename U> struct LazyBind { typedef U type; };
class Error
{
double Value_;
public:
template <class T> Error(Expr<T> const & E)
:
Value_(LazyBind<T, Some>::type()(E))
{}
};
struct Some
{
template <typename T>
double operator()(T const & t) { return 42.0; }
};
int main()
{
Expr<int> E;
Error err(E);
}