From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31993 invoked by alias); 12 Jun 2012 10:33:41 -0000 Received: (qmail 31984 invoked by uid 22791); 12 Jun 2012 10:33:40 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jun 2012 10:33:27 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53549] [4.7/4.8 Regression] g++ and armadillo 3.2.0, operator() is inaccessible Date: Tue, 12 Jun 2012 10:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: major X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.2 X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-06/txt/msg00671.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53549 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fabien at gcc dot gnu.org --- Comment #7 from Jonathan Wakely 2012-06-12 10:33:26 UTC --- I *think* this is equivalent: template class M { public: int operator()(unsigned); }; template class C : public M { public: using M::operator(); int operator()(); template class F : public C { public: using C::operator(); }; }; int main() { C::F<2> f; f(); } using.cc: In instantiation of 'class C::F<2>': using.cc:29:18: required from here using.cc:14:9: error: 'int C::operator()()' is inaccessible int operator()(); ^ using.cc:18:15: error: within this context class F : public C ^ There's only one "inaccesible" error because ther's only one operator() overload in the reduced example, ading a const overload (as in the original) gives two "inaccessible" errors. This looks like another "using" issue, CC'ing Fabien. N.B. Clang++ accepts the example above, but Comeau online rejects this because C::F uses C before it is complete. I think Comeau is correct. Moving the definition of F to a point when C is complete is acepted by Comeau and Clang and older G++ versions but gives a different error with G++ trunk: template class M { public: int operator()(unsigned); }; template class C : public M { public: using M::operator(); int operator()(); template class F; }; template template class C::F : public C { public: using C::operator(); }; int main() { C::F<2> f; f(); } using.cc:26:30: error: no members matching 'C::operator()' in 'class C' using C::operator(); ^