From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29851 invoked by alias); 25 Aug 2009 14:39:52 -0000 Received: (qmail 29385 invoked by uid 48); 25 Aug 2009 14:39:25 -0000 Date: Tue, 25 Aug 2009 14:39:00 -0000 Message-ID: <20090825143925.29384.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/40685] explicit constructor is used where only implicit ctors are allowed In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bangerth at gmail dot com" 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: 2009-08/txt/msg01993.txt.bz2 ------- Comment #2 from bangerth at gmail dot com 2009-08-25 14:39 ------- Hm, confusing: ----------------------------- enum E {e}; struct A { A(int); explicit A(E) {}; }; int main () { A a = e; } ----------------------------- This compiles but not links becase A::A(int) is called. If I remove the explicit keyword, it calls A::A(E) and links fine. I must admit that I don't know whether that's correct. icc concurs with gcc, by the way. W. -- bangerth at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bangerth at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40685