public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: philippeb@videotron.ca
To: gcc-gnats@gcc.gnu.org
Subject: c++/7136: Template constants deduction
Date: Wed, 26 Jun 2002 23:06:00 -0000	[thread overview]
Message-ID: <20020627022312.25612.qmail@sources.redhat.com> (raw)


>Number:         7136
>Category:       c++
>Synopsis:       Template constants deduction
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 26 19:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     g++
>Release:        gcc version 2.95.4 20011006 (Debian prerelease)
>Organization:
>Environment:
Linux 2.2.19pre17 i686
>Description:
Pointer to member template constants are not properly resolved.  The compiler returns:

template.cpp:18: type/value mismatch at argument 2 in template parameter list for `template<_T, int _T::*<anonymous> > struct Number'
template.cpp:18:   expected a constant of type `int _T::*', got `int _T::*'
template.cpp:19: ISO C++ forbids declaration of `parameter' with no type
template.cpp: In function `int main()':
template.cpp:27: no matching function for call to `foo(Number<Type, &Type::i>)'
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="template.cpp"
Content-Disposition: inline; filename="template.cpp"

#include <iostream>

using namespace std;


struct Type
{
int i;
};

template <typename _T, int _T::*>
struct Number
{
};


template <typename _T, int _T::*>
void foo(Number<_T, int _T::*> const &)
{
cout << __PRETTY_FUNCTION__ << endl;
}



int main()
{
foo(Number<Type, & Type::i>());

return 0;
}



             reply	other threads:[~2002-06-27  2:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-26 23:06 philippeb [this message]
2002-07-03 12:45 nathan
2003-01-23  3:16 bangerth
2003-01-23  5:36 Philippe A. Bouchard
2003-01-23 15:06 Wolfgang Bangerth

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=20020627022312.25612.qmail@sources.redhat.com \
    --to=philippeb@videotron.ca \
    --cc=gcc-gnats@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).