From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9269 invoked by alias); 21 Jul 2010 02:49:56 -0000 Received: (qmail 9219 invoked by uid 48); 21 Jul 2010 02:49:36 -0000 Date: Wed, 21 Jul 2010 02:49:00 -0000 Message-ID: <20100721024936.9218.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/45012] Invalid ambiguity on partial class specialization matching In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rodolfo at rodsoft dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg02160.txt.bz2 ------- Comment #1 from rodolfo at rodsoft dot org 2010-07-21 02:49 ------- The code I posted was meant to be compiled in c++0x mode, but if we write directly the definition of std::enable_if, it also happens in c++03 mode. So, instead of #include , one should write: template struct enable_if; template struct enable_if { typedef T type; }; Of course, I forgot to add the error messages: teste.cpp:30: error: ambiguous class template instantiation for ‘struct foo, bar<2>, void>’ teste.cpp:19: error: candidates are: struct foo, V, typename enable_if<((M == RUNTIME) || (M == 2)), void>::type> teste.cpp:25: error: struct foo, V2, typename enable_if<((M == RUNTIME) || (M == 2)), void>::type> teste.cpp:30: error: aggregate ‘foo, bar<2>, void> x’ has incomplete type and cannot be defined -- rodolfo at rodsoft dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rodolfo at rodsoft dot org Keywords| |rejects-valid Known to fail| |4.4.3 4.5.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45012