Thread View: comp.std.c++
1 messages
1 total messages
Started by J. Kanze
Tue, 05 Sep 1995 15:45
Access control on default parameters.
Author: J. Kanze
Date: Tue, 05 Sep 1995 15:45
Date: Tue, 05 Sep 1995 15:45
44 lines
1881 bytes
1881 bytes
According to the draft standard: ``In member function declarations,
names in default argument expressins are looked up in the scope of the
class like names in member function bodies.'' (Section 8.3.6, para. 6.)
Does this mean that access rights are also checked as if the name were
in a member function body? In sum, is the following code legal:
class X
{
public :
class Y
{
} ;
X( Y a = dfltA ) ;
private :
static Y dfltA ;
} ;
void
f()
{
X x ;
}
I would normally think not, since normally access checking is orthogonal
to name lookup/scope resolution. But the compilers I have access to
disagree.
(Steve, Mike: two of the compilers which disagree are originally from
Taumet. Did you guys change your minds somewhere along the line? And
if Sun CC represents your latest thinking, then your evolution is in
just the opposite direction of g++; the current g++ refuses this, but if
memory serves me right, older versions accepted it.)
--
James Kanze (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle--
--Beratung in industrieller Datenverarbeitung
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads