* [Bug c++/38681] Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr]
2008-12-31 7:42 [Bug c++/38681] New: Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr] juvvij at gmail dot com
@ 2008-12-31 7:44 ` juvvij at gmail dot com
2008-12-31 7:44 ` juvvij at gmail dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: juvvij at gmail dot com @ 2008-12-31 7:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from juvvij at gmail dot com 2008-12-31 07:43 -------
Created an attachment (id=17018)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17018&action=view)
Details of gcc from output of g++ -v -save-temps
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38681
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/38681] Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr]
2008-12-31 7:42 [Bug c++/38681] New: Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr] juvvij at gmail dot com
2008-12-31 7:44 ` [Bug c++/38681] " juvvij at gmail dot com
@ 2008-12-31 7:44 ` juvvij at gmail dot com
2008-12-31 7:51 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: juvvij at gmail dot com @ 2008-12-31 7:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from juvvij at gmail dot com 2008-12-31 07:42 -------
Created an attachment (id=17017)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17017&action=view)
Preprocessed test case that causes the compiler error.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38681
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/38681] Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr]
2008-12-31 7:42 [Bug c++/38681] New: Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr] juvvij at gmail dot com
2008-12-31 7:44 ` [Bug c++/38681] " juvvij at gmail dot com
2008-12-31 7:44 ` juvvij at gmail dot com
@ 2008-12-31 7:51 ` pinskia at gcc dot gnu dot org
2008-12-31 16:12 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-31 7:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-12-31 07:49 -------
> ulong ConnectCB(GtkWidget* pWidget, const char* sigName, _R(_ClassType::*MemFun)(GtkWidget*, _A1))
> {
> typedef CBFamily2<_ClassType, _R, GtkWidget*, _A1, MemFun> TCallbackType;
This code is invalid code, you are using a non constant expression for a
template argument.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38681
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/38681] Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr]
2008-12-31 7:42 [Bug c++/38681] New: Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr] juvvij at gmail dot com
` (2 preceding siblings ...)
2008-12-31 7:51 ` pinskia at gcc dot gnu dot org
@ 2008-12-31 16:12 ` pinskia at gcc dot gnu dot org
2008-12-31 17:32 ` juvvij at gmail dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-31 16:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-12-31 16:10 -------
This is close to duplicate of bug 37093.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38681
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/38681] Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr]
2008-12-31 7:42 [Bug c++/38681] New: Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr] juvvij at gmail dot com
` (3 preceding siblings ...)
2008-12-31 16:12 ` pinskia at gcc dot gnu dot org
@ 2008-12-31 17:32 ` juvvij at gmail dot com
2008-12-31 17:42 ` pinskia at gcc dot gnu dot org
2009-01-30 15:52 ` bangerth at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: juvvij at gmail dot com @ 2008-12-31 17:32 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]
------- Comment #5 from juvvij at gmail dot com 2008-12-31 17:31 -------
>From the C++ standards doc (Latest download form the website) (excerpt listed
below), I thought that member functions could be allowed. I am not entirely
sure if *function* can also refer to *member-function*.
--------------------
4. A non-type template-parameter shall have one of the following (optionally
cv-qualified) types:
â integral or enumeration type,
â pointer to object or pointer to function,
â reference to object or reference to function,
â pointer to member., or
â in a constrained template (14.10), a type archetype T for which the
concept requirement std::NonTypeTemplateParamet
is part of the templateâs requirements.
--------------------
Did I understand this wrong ? Does the correct interpretation of the standard
not allow for member-function-pointers as non-type arguments ?
The following links point to a different interpretation.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101628
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=196204
http://objectmix.com/c/382443-samples-non-type-template-argument-other-than-integral-types.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38681
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/38681] Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr]
2008-12-31 7:42 [Bug c++/38681] New: Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr] juvvij at gmail dot com
` (4 preceding siblings ...)
2008-12-31 17:32 ` juvvij at gmail dot com
@ 2008-12-31 17:42 ` pinskia at gcc dot gnu dot org
2009-01-30 15:52 ` bangerth at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-31 17:42 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-12-31 17:40 -------
> â pointer to member., or
This includes pointer to member functions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38681
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/38681] Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr]
2008-12-31 7:42 [Bug c++/38681] New: Internal compiler error. expr.c:6956 [Template instantiation with non-type value of member function ptr] juvvij at gmail dot com
` (5 preceding siblings ...)
2008-12-31 17:42 ` pinskia at gcc dot gnu dot org
@ 2009-01-30 15:52 ` bangerth at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at gmail dot com @ 2009-01-30 15:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from bangerth at gmail dot com 2009-01-30 15:51 -------
(In reply to comment #5)
> Did I understand this wrong ? Does the correct interpretation of the standard
> not allow for member-function-pointers as non-type arguments ?
It does, but it requires them to be in a constant-expression context -- i.e.
informally speaking the compiler needs to know *at compile time* which member
function you refer to. You can use a function argument as a template
argument.
I think this is indeed a duplicate of PR 37093.
W.
W.
*** This bug has been marked as a duplicate of 37093 ***
--
bangerth at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at gmail dot com
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38681
^ permalink raw reply [flat|nested] 8+ messages in thread