From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24082 invoked by alias); 18 Oct 2003 19:47:26 -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 24073 invoked by uid 48); 18 Oct 2003 19:47:25 -0000 Date: Sat, 18 Oct 2003 19:50:00 -0000 Message-ID: <20031018194725.24072.qmail@sources.redhat.com> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031018082407.12672.igodard@pacbell.net> References: <20031018082407.12672.igodard@pacbell.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/12672] Evals template defaults args that it should not X-Bugzilla-Reason: CC X-SW-Source: 2003-10/txt/msg01500.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12672 bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Last reconfirmed|0000-00-00 00:00:00 |2003-10-18 19:47:24 date| | ------- Additional Comments From bangerth at dealii dot org 2003-10-18 19:47 ------- Confirmed. Here's something even shorter: --------------------------- template struct S { typedef typename T::type type; }; template::type> struct A {}; template A Foo(T); template void Foo(T, T); int main() { Foo(1, 2); } ---------------------------- This fails to compile because the compiler tries to instantiate the return type of the first Foo function. Whether that is actually taken is irrelevant here, since we are only doing name lookup at this stage, but we shouldn't error out: this is a SFINAE failure and should just remove the first Foo function from the list of candidates. It shouldn't be an error. I confirm this for 3.3 and 3.4 builds from 2003-09-19, since this is the latest I presently have. They both say g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc: In instantiation of `S': x.cc:12: instantiated from here x.cc:2: error: `int' is not a class, struct, or union type What startles me a bit is that icc7 also shows the error. I am pretty sure, though, that this is in error as well. W.