🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #876

Pointers to Template Functions

#876
From: John B. Plevyak
Date: Tue, 01 Sep 1992 23:26
34 lines
1239 bytes
The following code reports a failed assertion:

#include <iostream.h>

template<class K>
void error(K i) {
  cerr << i << "\n";
}

main() {
  void (*pf)(int);
  pf = &error;

  (*pf)(5);
}

REPORTS:

cp-class.c:3977: failed assertion `TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL'
/b/gnu/bin/gcc: Internal compiler error: program cc1plus got fatal signal 6

According to our understanding of Stroustrup's 2nd Ed this would seem
to be legal code.
Is it?  If so is a fix expected in the next version (2.3)?

Thanx

--- 
Vijay Karamcheti    vijayk@red-herring.cs.uiuc.edu
John Plevyak        plevyak@uiuc.edu      (217) 333-5219
Concurrent Systems Architecture Group 
University of Illinois at Urbana-Champaign
1304 West Springfield
Urbana, IL	61801
Technical Details
Message-ID: <1992Sep1.232602.3810@m.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.uiuc.edu!jplevyak

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.uiuc.edu!jplevyak
From: jplevyak@cs.uiuc.edu (John B. Plevyak)
Subject: Pointers to Template Functions
Message-ID: <1992Sep1.232602.3810@m.cs.uiuc.edu>
Keywords: templates function pointers
Sender: gnulists@ai.mit.edu
Organization: University of Illinois, Dept of Computer Science
Distribution: gnu
Date: Tue, 1 Sep 1992 23:26:02 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 35