From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1832 invoked by alias); 13 Mar 2015 02:12:02 -0000 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 Received: (qmail 1815 invoked by uid 48); 13 Mar 2015 02:11:59 -0000 From: "rs2740 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65415] New: using, base class static member function template, and decltype Date: Fri, 13 Mar 2015 02:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rs2740 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg01390.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65415 Bug ID: 65415 Summary: using, base class static member function template, and decltype Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rs2740 at gmail dot com >>From http://stackoverflow.com/questions/29013260. Minimized repro: struct default_check { template static int check(...); }; struct is_addable : default_check { using default_check::check; // #1 using type = decltype(check(0)); }; int main() {} gcc HEAD 5.0.0 20150312 (experimental) reports prog.cc:9:31: error: expected primary-expression before 'void' using type = decltype(check(0)); ^ prog.cc:9:31: error: expected ')' before 'void' prog.cc:9:16: error: expected type-specifier before 'decltype' using type = decltype(check(0)); ^ i.e., for some reason the `check` brought in by `using` isn't found. Oddly enough, commenting out line #1 makes the code compile. (The original code in the linked SO question had a separate check() overload in is_addable. In that case, lookup for some reason only found the is_addable overload and not the base class one brought in by `using`)