From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6526 invoked by alias); 28 Feb 2005 15:54:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6409 invoked by uid 48); 28 Feb 2005 15:54:09 -0000 Date: Mon, 28 Feb 2005 22:11:00 -0000 Message-ID: <20050228155409.6408.qmail@sourceware.org> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050223171336.20173.sstrasser@systemhaus-gruppe.de> References: <20050223171336.20173.sstrasser@systemhaus-gruppe.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/20173] [3.3/3.4/4.0/4.1 regression] gcc accepts invalid partial specialization attempt of member function X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg03472.txt.bz2 List-Id: ------- Additional Comments From bangerth at dealii dot org 2005-02-28 15:53 ------- I believe the code is invalid: you try to do a partial specialization of a member function, but there is no such thing -- you need to use an overload instead. To me this looks like an accept-invalid. Here's what icc has to say: g/x> icc -Xc -ansi -c x.cc x.cc(10): error: declaration is incompatible with function template "void A::function(T) [with AT=int]" (declared at line 5) void A::function(TTT *){std::cerr << '2';} ^ x.cc(16): warning #592: variable "b" is used before its value is set a.function(b); ^ compilation aborted for x.cc (code 2) This also seems like a regression to me, since gcc2.95.3 gives me this: g/x> /home/bangerth/bin/gcc-2*/bin/c++ -c x.cc -ansi -pedantic x.cc:10: template parameters specified in specialization x.cc:10: prototype for `void A::function(TTT *)' does not match any in class `A' x.cc:5: candidate is: template void A::function(T) x.cc: In method `void A::function(TTT *)': x.cc:10: must specialize `struct A' before defining member `void A::function(TTT *)' x.cc:10: template definition of non-template `void A::function(TTT *)' W. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Keywords| |accepts-invalid Known to fail| |3.2.3 3.3.5 3.4.3 4.0.0 Known to work| |2.95.3 Last reconfirmed|0000-00-00 00:00:00 |2005-02-28 15:54:00 date| | Summary|Wrong template function |[3.3/3.4/4.0/4.1 regression] |specialization chosen |gcc accepts invalid partial | |specialization attempt of | |member function Target Milestone|--- |3.4.4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20173