From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23549 invoked by alias); 26 Aug 2004 09:54:33 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 23390 invoked from network); 26 Aug 2004 09:54:32 -0000 Received: from unknown (HELO mproxy.gmail.com) (216.239.56.251) by sourceware.org with SMTP; 26 Aug 2004 09:54:32 -0000 Received: by mproxy.gmail.com with SMTP id q44so48922cwc for ; Thu, 26 Aug 2004 02:54:31 -0700 (PDT) Received: by 10.11.99.62 with SMTP id w62mr8840cwb; Thu, 26 Aug 2004 02:54:31 -0700 (PDT) Received: by 10.11.99.26 with HTTP; Thu, 26 Aug 2004 02:54:31 -0700 (PDT) Message-ID: <41a2e2dc04082602547057f04c@mail.gmail.com> Date: Thu, 26 Aug 2004 14:16:00 -0000 From: Boris von Loesch Reply-To: Boris von Loesch To: gcc-help@gcc.gnu.org Subject: Problem with implicit conversion (GCC 3.4.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00232.txt.bz2 Hello, I have written a program that compiles just fine with GCC 3.3. With GCC 3.4.1 it results in this error: g++ -O0 -g3 -Wall -c -oTestp.o ../Testp.c ../Testp.c: In function `int main()': ../Testp.c:26: error: no match for 'operator<=' in 't <= 2.0e+0' Please help me, I have no idea where the problem is. Here is the code: template class BasisF; template inline bool operator<=(const BasisF &a, const BasisF &b){return a.x <= b.x;} template class BasisF{ public: T x; BasisF(const T &_x = T()): x(_x){} BasisF(const BasisF &_b): x(_b.x){} ~BasisF(){} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=<>(const BasisF &a, const BasisF &b); }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t,2.0)<=0) return 1; return 0; } Regards, Boris