This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler warnings while compiling gcc with clangâ
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Aditya K <hiraditya at msn dot com>
- Cc: "pinskia at gmail dot com" <pinskia at gmail dot com>, Renato Golin <renato dot golin at linaro dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 5 May 2015 21:57:08 +0100
- Subject: Re: Compiler warnings while compiling gcc with clangâ
- Authentication-results: sourceware.org; auth=none
- References: <BLU179-W15F1B75976EAA6915DFE1BB6D10 at phx dot gbl> <CA+=Sn1k+1NUE_o2mkWRad_-wgQuQCiyHPmNYc00zeH+N61qZXQ at mail dot gmail dot com> <CAMSE1kciuStXmVRor4Mc=qb78xZYarwdHAAz2xme7L00bajWuw at mail dot gmail dot com> <55EE0A4A-97FF-4A75-867F-B91B9EAD00D1 at gmail dot com> <BLU179-W821F0444DBDE3555C97781B6D10 at phx dot gbl>
On 5 May 2015 at 12:39, Aditya K wrote:
> There are however, other differences between class and struct (http://stackoverflow.com/a/999810/811335) i.e.,
>
> 1. In absence of an access-specifier for a base class, public is assumed when the derived class is declared struct and private is assumed when the class is declared class.
Yes, everyone here knows that. That is only relevant to the definition
of the class, which can only occur once. For the purposes of
declarations that are not definitions there is no difference.
> 2. class can be used in place of a typename to declare a template parameter, while the struct cannot.
Completely irrelevant in this context. The use of 'class' in a
template parameter list has nothing to do with struct or class types,
nor forward declarations of struct or class types.