From 80050373588940123
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,48dfb24b32c49e6f
X-Google-Attributes: gidf78e5,public
From: Gabriel Dos Reis <gdr@merlin.codesourcery.com>
Subject: Re: friendly main
Date: 2000/07/27
Message-ID: <m37la8ages.fsf@merlin.codesourcery.com>#1/1
X-Deja-AN: 651083055
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <8ln9tu$uv2$1@nnrp1.deja.com>
X-Server-Date: 26 Jul 2000 19:35:26 GMT
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Content-Type: text/plain; charset=US-ASCII
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 964636775 mail2news:1383 mail2news mail2news.demon.co.uk
Organization: CodeSourcery, LLC
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Mime-Version: 1.0 (generated by tm-edit 7.106)
Newsgroups: comp.std.c++

assert@my-deja.com writes:

| #include <iostream>
| 
| using namespace std;
| 
| struct S
| {
|   friend int main () { cout  << "boo" << endl; }
| };
| 
| // well formed ?

No.

3.6.1/3:
  [...] A program that declares main to be inline or static is ill-formed.

-- 
Gabriel Dos Reis, gdr@codesourcery.com

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




