public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/36715]  New: not compile code, but must
@ 2008-07-03  9:25 yeolahim at gmail dot com
  2008-07-03  9:52 ` [Bug c++/36715] " paolo dot carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: yeolahim at gmail dot com @ 2008-07-03  9:25 UTC (permalink / raw)
  To: gcc-bugs

try compile:

#include <iostream>

template <typename T, size_t Count>
inline
size_t countof ( const T (&) [Count] )
{
  return Count;
}

int main(int argc, char* argv[])
{
  struct { int x1; int x2;} x [100];
  std::cout << countof(x) << std::endl;

  int y [101];
  std::cout << countof(y) << std::endl;

  struct Z { int x1; int x2;} z [102];
  std::cout << countof(z) << std::endl;

  std::cin.get();
  return 0;
}


gcc info(gcc -v):
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)


-- 
           Summary: not compile code, but must
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yeolahim at gmail dot com
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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


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

* [Bug c++/36715] not compile code, but must
  2008-07-03  9:25 [Bug c++/36715] New: not compile code, but must yeolahim at gmail dot com
@ 2008-07-03  9:52 ` paolo dot carlini at oracle dot com
  2008-07-03 12:20 ` paolo dot carlini at oracle dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-07-03  9:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2008-07-03 09:52 -------
Not a bug: in C++98 local types are not allowed as template arguments. Just
move the anonymous struct and Z before the main.


-- 

paolo dot carlini at oracle dot com changed:

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


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


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

* [Bug c++/36715] not compile code, but must
  2008-07-03  9:25 [Bug c++/36715] New: not compile code, but must yeolahim at gmail dot com
  2008-07-03  9:52 ` [Bug c++/36715] " paolo dot carlini at oracle dot com
  2008-07-03 12:20 ` paolo dot carlini at oracle dot com
@ 2008-07-03 12:20 ` paolo dot carlini at oracle dot com
  2008-07-03 12:21 ` paolo dot carlini at oracle dot com
  2008-07-03 12:21 ` paolo dot carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-07-03 12:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo dot carlini at oracle dot com  2008-07-03 12:20 -------
*** Bug 36717 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/36715] not compile code, but must
  2008-07-03  9:25 [Bug c++/36715] New: not compile code, but must yeolahim at gmail dot com
  2008-07-03  9:52 ` [Bug c++/36715] " paolo dot carlini at oracle dot com
@ 2008-07-03 12:20 ` paolo dot carlini at oracle dot com
  2008-07-03 12:20 ` paolo dot carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-07-03 12:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from paolo dot carlini at oracle dot com  2008-07-03 12:19 -------
*** Bug 36716 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/36715] not compile code, but must
  2008-07-03  9:25 [Bug c++/36715] New: not compile code, but must yeolahim at gmail dot com
                   ` (2 preceding siblings ...)
  2008-07-03 12:20 ` paolo dot carlini at oracle dot com
@ 2008-07-03 12:21 ` paolo dot carlini at oracle dot com
  2008-07-03 12:21 ` paolo dot carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-07-03 12:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from paolo dot carlini at oracle dot com  2008-07-03 12:20 -------
*** Bug 36718 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/36715] not compile code, but must
  2008-07-03  9:25 [Bug c++/36715] New: not compile code, but must yeolahim at gmail dot com
                   ` (3 preceding siblings ...)
  2008-07-03 12:21 ` paolo dot carlini at oracle dot com
@ 2008-07-03 12:21 ` paolo dot carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-07-03 12:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from paolo dot carlini at oracle dot com  2008-07-03 12:20 -------
*** Bug 36719 has been marked as a duplicate of this bug. ***


-- 


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


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

end of thread, other threads:[~2008-07-03 12:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-03  9:25 [Bug c++/36715] New: not compile code, but must yeolahim at gmail dot com
2008-07-03  9:52 ` [Bug c++/36715] " paolo dot carlini at oracle dot com
2008-07-03 12:20 ` paolo dot carlini at oracle dot com
2008-07-03 12:20 ` paolo dot carlini at oracle dot com
2008-07-03 12:21 ` paolo dot carlini at oracle dot com
2008-07-03 12:21 ` paolo dot carlini at oracle dot com

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).