public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rs2740 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-65415-4@http.gcc.gnu.org/bugzilla/> (raw)

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<typename U> static int check(...);
};

struct is_addable : default_check
{
  using default_check::check; // #1
  using type = decltype(check<void>(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<void>(0));
                              ^
prog.cc:9:31: error: expected ')' before 'void'
prog.cc:9:16: error: expected type-specifier before 'decltype'
  using type = decltype(check<void>(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`)


             reply	other threads:[~2015-03-13  2:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13  2:12 rs2740 at gmail dot com [this message]
2015-03-13 10:26 ` [Bug c++/65415] " redi at gcc dot gnu.org
2015-03-25 14:38 ` mpolacek at gcc dot gnu.org
2015-05-22  9:51 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65415-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).