public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14748] New: class member field name __ct
@ 2004-03-26 19:29 Holger dot Ahl at web dot de
  2004-03-26 19:33 ` [Bug c++/14748] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Holger dot Ahl at web dot de @ 2004-03-26 19:29 UTC (permalink / raw)
  To: gcc-bugs

I cannot believe, that this is a bug, but I did not find any explanation for 
this behaviour. When I compile following simple class, I get an error:

class Ct {
public:
 int __ct;

 Ct() : __ct(0) {};
};

int main() {
  Ct ctobj;
}



Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.3/specs
Configured with: ../configure --disable-nls --with-as=/usr/ccs/bin/as --with-
ld=/usr/ccs/bin/ld
Thread model: posix
gcc version 3.2.3
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.3/cpp0 -lang-c++ -D__GNUG__=3 -
D__DEPRECATED -D__EXCEPTIONS -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -
D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -Dsparc -Dsun -Dunix -D__svr4__ -
D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__ -D__sun__ -D__unix__ -
D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc -D__sun -D__unix -
Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -
D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -
D__EXTENSIONS__ -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -
D__WCHAR_TYPE__=long int -D__WINT_TYPE__=long int -D__GCC_NEW_VARARGS__ -
Acpu=sparc -Amachine=sparc test_ct.cc test_ct.ii
GNU CPP version 3.2.3 (cpplib) (sparc ELF)
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/c++/3.2.3
 /usr/local/include/c++/3.2.3/sparc-sun-solaris2.8
 /usr/local/include/c++/3.2.3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.3/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.3/cc1plus -fpreprocessed 
test_ct.ii -quiet -dumpbase test_ct.cc -version -o test_ct.s
GNU CPP version 3.2.3 (cpplib) (sparc ELF)
GNU C++ version 3.2.3 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.2.3.

test_ct.cc: In constructor `Ct::Ct()':
test_ct.cc:6: class `Ct' does not have any field named `__ct'


my *.ii file looks like this:

# 1 "test_ct.cc"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "test_ct.cc"

class Ct {
public:
 int __ct;

 Ct() : __ct(0) {};
};

int main() {
  Ct ctobj;
}

-- 
           Summary: class member field name __ct
           Product: gcc
           Version: 3.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Holger dot Ahl at web dot de
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14748


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14748] class member field name __ct
  2004-03-26 19:29 [Bug c++/14748] New: class member field name __ct Holger dot Ahl at web dot de
@ 2004-03-26 19:33 ` pinskia at gcc dot gnu dot org
  2004-03-26 19:40 ` bangerth at dealii dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-26 19:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-26 19:33 -------
Identifiers which have two underscores in front of them are reserved for the compiler so this is 
invalid.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14748


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14748] class member field name __ct
  2004-03-26 19:29 [Bug c++/14748] New: class member field name __ct Holger dot Ahl at web dot de
  2004-03-26 19:33 ` [Bug c++/14748] " pinskia at gcc dot gnu dot org
@ 2004-03-26 19:40 ` bangerth at dealii dot org
  2004-03-26 19:41 ` [Bug c++/14748] Unhelpful error message about use of invalid " bangerth at dealii dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-03-26 19:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-26 19:40 -------
While Andrew is right that you must not use names that start with 
two underscores, the error message we give is really not very  
helpful. I also don't know where it comes from: it is certainly not 
the preprocessor that is replacing the token by something else, and 
the compiler does not complain about the declaration of the field, 
only about its use. We should be able to do better here. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
           Keywords|                            |diagnostic
      Known to fail|                            |2.95.3 3.2.3 3.3.3 3.4.0
                   |                            |3.5.0
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14748


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14748] Unhelpful error message about use of invalid field name __ct
  2004-03-26 19:29 [Bug c++/14748] New: class member field name __ct Holger dot Ahl at web dot de
  2004-03-26 19:33 ` [Bug c++/14748] " pinskia at gcc dot gnu dot org
  2004-03-26 19:40 ` bangerth at dealii dot org
@ 2004-03-26 19:41 ` bangerth at dealii dot org
  2004-03-26 19:55 ` pinskia at gcc dot gnu dot org
  2005-01-29 13:37 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-03-26 19:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-26 19:41 -------
Confirmed with all compilers since at least 2.95. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-26 19:41:41
               date|                            |
            Summary|class member field name __ct|Unhelpful error message
                   |                            |about use of invalid field
                   |                            |name __ct


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14748


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14748] Unhelpful error message about use of invalid field name __ct
  2004-03-26 19:29 [Bug c++/14748] New: class member field name __ct Holger dot Ahl at web dot de
                   ` (2 preceding siblings ...)
  2004-03-26 19:41 ` [Bug c++/14748] Unhelpful error message about use of invalid " bangerth at dealii dot org
@ 2004-03-26 19:55 ` pinskia at gcc dot gnu dot org
  2005-01-29 13:37 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-26 19:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14748


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14748] Unhelpful error message about use of invalid field name __ct
  2004-03-26 19:29 [Bug c++/14748] New: class member field name __ct Holger dot Ahl at web dot de
                   ` (3 preceding siblings ...)
  2004-03-26 19:55 ` pinskia at gcc dot gnu dot org
@ 2005-01-29 13:37 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-29 13:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-29 13:37 -------
Fixed by accepting it in 4.0.0.  What changed was the name of the constructor internally was renamed 
to " __ct".

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14748


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-01-29 13:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-26 19:29 [Bug c++/14748] New: class member field name __ct Holger dot Ahl at web dot de
2004-03-26 19:33 ` [Bug c++/14748] " pinskia at gcc dot gnu dot org
2004-03-26 19:40 ` bangerth at dealii dot org
2004-03-26 19:41 ` [Bug c++/14748] Unhelpful error message about use of invalid " bangerth at dealii dot org
2004-03-26 19:55 ` pinskia at gcc dot gnu dot org
2005-01-29 13:37 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).