public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23437] New: error: ... cannot appear in a constant-expression
@ 2005-08-17  9:41 jmihalicza at graphisoft dot com
  2005-08-17  9:44 ` [Bug c++/23437] " jmihalicza at graphisoft dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: jmihalicza at graphisoft dot com @ 2005-08-17  9:41 UTC (permalink / raw)
  To: gcc-bugs

Compilers without errors using
   gcc 3.3
   MSVC 7.1
   MSVC 8.0
   Comeau 4.3.3

-- 
           Summary: error: ... cannot appear in a constant-expression
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jmihalicza at graphisoft dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-pc-linux-gnu
  GCC host triplet: i486-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu


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


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

* [Bug c++/23437] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
  2005-08-17  9:44 ` [Bug c++/23437] " jmihalicza at graphisoft dot com
@ 2005-08-17  9:44 ` jmihalicza at graphisoft dot com
  2005-08-17  9:45 ` jmihalicza at graphisoft dot com
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jmihalicza at graphisoft dot com @ 2005-08-17  9:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jmihalicza at graphisoft dot com  2005-08-17 09:42 -------
Created an attachment (id=9514)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9514&action=view)
source code


-- 


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


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

* [Bug c++/23437] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
@ 2005-08-17  9:44 ` jmihalicza at graphisoft dot com
  2005-08-17  9:44 ` jmihalicza at graphisoft dot com
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jmihalicza at graphisoft dot com @ 2005-08-17  9:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jmihalicza at graphisoft dot com  2005-08-17 09:44 -------
Created an attachment (id=9515)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9515&action=view)
command (error) output


-- 


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


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

* [Bug c++/23437] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
  2005-08-17  9:44 ` [Bug c++/23437] " jmihalicza at graphisoft dot com
  2005-08-17  9:44 ` jmihalicza at graphisoft dot com
@ 2005-08-17  9:45 ` jmihalicza at graphisoft dot com
  2005-08-17  9:45 ` jmihalicza at graphisoft dot com
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jmihalicza at graphisoft dot com @ 2005-08-17  9:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jmihalicza at graphisoft dot com  2005-08-17 09:44 -------
Created an attachment (id=9516)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9516&action=view)
command that produces the bug


-- 


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


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

* [Bug c++/23437] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (2 preceding siblings ...)
  2005-08-17  9:45 ` jmihalicza at graphisoft dot com
@ 2005-08-17  9:45 ` jmihalicza at graphisoft dot com
  2005-08-17  9:51 ` jmihalicza at graphisoft dot com
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jmihalicza at graphisoft dot com @ 2005-08-17  9:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jmihalicza at graphisoft dot com  2005-08-17 09:45 -------
Created an attachment (id=9517)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9517&action=view)
preprocessed source


-- 


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


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

* [Bug c++/23437] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (3 preceding siblings ...)
  2005-08-17  9:45 ` jmihalicza at graphisoft dot com
@ 2005-08-17  9:51 ` jmihalicza at graphisoft dot com
  2005-08-17 10:17 ` jmihalicza at graphisoft dot com
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jmihalicza at graphisoft dot com @ 2005-08-17  9:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jmihalicza at graphisoft dot com  2005-08-17 09:45 -------
Created an attachment (id=9518)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9518&action=view)
assembler source


-- 


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


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

* [Bug c++/23437] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (4 preceding siblings ...)
  2005-08-17  9:51 ` jmihalicza at graphisoft dot com
@ 2005-08-17 10:17 ` jmihalicza at graphisoft dot com
  2005-08-17 11:51 ` [Bug c++/23437] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jmihalicza at graphisoft dot com @ 2005-08-17 10:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jmihalicza at graphisoft dot com  2005-08-17 10:16 -------
(In reply to comment #0)
> Compilers without errors using
         ^ forget
Oops, I meant: Compiles...
>    gcc 3.3
>    MSVC 7.1
>    MSVC 8.0
>    Comeau 4.3.3



-- 


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (5 preceding siblings ...)
  2005-08-17 10:17 ` jmihalicza at graphisoft dot com
@ 2005-08-17 11:51 ` pinskia at gcc dot gnu dot org
  2005-08-17 22:13 ` giovannibajo at libero dot it
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-17 11:51 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|i486-pc-linux-gnu           |
   GCC host triplet|i486-pc-linux-gnu           |
 GCC target triplet|i486-pc-linux-gnu           |
           Keywords|                            |rejects-valid
            Summary|error: ... cannot appear in |[3.4/4.0/4.1 Regression]
                   |a constant-expression       |error: ... cannot appear in
                   |                            |a constant-expression
   Target Milestone|---                         |4.0.2


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (6 preceding siblings ...)
  2005-08-17 11:51 ` [Bug c++/23437] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-08-17 22:13 ` giovannibajo at libero dot it
  2005-08-17 22:33 ` giovannibajo at libero dot it
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: giovannibajo at libero dot it @ 2005-08-17 22:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-08-17 21:59 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-17 21:59:42
               date|                            |


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (7 preceding siblings ...)
  2005-08-17 22:13 ` giovannibajo at libero dot it
@ 2005-08-17 22:33 ` giovannibajo at libero dot it
  2005-08-19 18:09 ` giovannibajo at libero dot it
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: giovannibajo at libero dot it @ 2005-08-17 22:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-08-17 22:13 -------
Dumdelidum...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |giovannibajo at libero dot
                   |dot org                     |it
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (8 preceding siblings ...)
  2005-08-17 22:33 ` giovannibajo at libero dot it
@ 2005-08-19 18:09 ` giovannibajo at libero dot it
  2005-09-04 21:36 ` raghavan at cavs dot msstate dot edu
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: giovannibajo at libero dot it @ 2005-08-19 18:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-08-19 18:06 -------
Patch posted, waiting for review:
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01169.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |08/msg01169.html
           Keywords|                            |patch


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (9 preceding siblings ...)
  2005-08-19 18:09 ` giovannibajo at libero dot it
@ 2005-09-04 21:36 ` raghavan at cavs dot msstate dot edu
  2005-09-05 23:28 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: raghavan at cavs dot msstate dot edu @ 2005-09-04 21:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From raghavan at cavs dot msstate dot edu  2005-09-04 21:36 -------
Subject:  [3.4/4.0/4.1 Regression] error: ... cannot appear
 in a constant-expression

Hi,
       Is this bug fixed? I'm still unable to use a static constant in 
an expression to declare another static constant. I'm using gcc version 
4.0.1

Thanks,

Sridhar


-- 


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (10 preceding siblings ...)
  2005-09-04 21:36 ` raghavan at cavs dot msstate dot edu
@ 2005-09-05 23:28 ` giovannibajo at libero dot it
  2005-09-08 20:33 ` may at cavs dot msstate dot edu
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: giovannibajo at libero dot it @ 2005-09-05 23:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-09-05 23:28 -------
Not yet, I still have to find some time to commit the patch. It will be fixed 
in GCC 4.1 and GCC 4.0.2.

-- 


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (11 preceding siblings ...)
  2005-09-05 23:28 ` giovannibajo at libero dot it
@ 2005-09-08 20:33 ` may at cavs dot msstate dot edu
  2005-09-12 18:39 ` pannuri at cavs dot msstate dot edu
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: may at cavs dot msstate dot edu @ 2005-09-08 20:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From may at cavs dot msstate dot edu  2005-09-08 20:33 -------
I applied that patch, but am still having the same problem.  Any ideas?

-- 


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (12 preceding siblings ...)
  2005-09-08 20:33 ` may at cavs dot msstate dot edu
@ 2005-09-12 18:39 ` pannuri at cavs dot msstate dot edu
  2005-09-12 20:45 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pannuri at cavs dot msstate dot edu @ 2005-09-12 18:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pannuri at cavs dot msstate dot edu  2005-09-12 18:39 -------
It seems this works:
#include <math.h>
 #include <stdio.h>

 static const double PI = M_PI;
 static const double TWO_PI = (2.0*PI);
 static const double HALF_PI = (M_PI_2);
 static const double QUARTER_PI = (M_PI_4);

 main (int argc, char** argv) {
  int i = 0;
  printf("%ld\n", i);
  return 0;
 }

But putting these inside of a class doesn't work:

class Foo {
  Foo(){};
  ~Foo(){};
  static const double PI = M_PI;
  static const double TWO_PI = (2.0*PI);
  static const double HALF_PI = (M_PI_2);
  static const double QUARTER_PI = (M_PI_4);
};

-Madhulika 

-- 


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (13 preceding siblings ...)
  2005-09-12 18:39 ` pannuri at cavs dot msstate dot edu
@ 2005-09-12 20:45 ` pinskia at gcc dot gnu dot org
  2005-09-27 16:23 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-12 20:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-12 20:45 -------
ICE started
: Search converges between 2003-01-15-trunk (#165) and 2003-01-17-trunk (#166).

Then stoped:
: Search converges between 2003-02-03-trunk (#174) and 2003-02-04-trunk (#175).


-- 


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (14 preceding siblings ...)
  2005-09-12 20:45 ` pinskia at gcc dot gnu dot org
@ 2005-09-27 16:23 ` mmitchel at gcc dot gnu dot org
  2005-09-29  8:30 ` bonzini at gcc dot gnu dot org
  2005-09-29  8:34 ` bonzini at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:23 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (15 preceding siblings ...)
  2005-09-27 16:23 ` mmitchel at gcc dot gnu dot org
@ 2005-09-29  8:30 ` bonzini at gcc dot gnu dot org
  2005-09-29  8:34 ` bonzini at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-09-29  8:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-09-29 08:30 -------
Giovanni, any news?

-- 


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


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

* [Bug c++/23437] [3.4/4.0/4.1 Regression] error: ... cannot appear in a constant-expression
  2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
                   ` (16 preceding siblings ...)
  2005-09-29  8:30 ` bonzini at gcc dot gnu dot org
@ 2005-09-29  8:34 ` bonzini at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-09-29  8:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-09-29 08:34 -------
> But putting these inside of a class doesn't work:
> 
> class Foo {
>   Foo(){};
>   ~Foo(){};
>   static const double PI = M_PI;
>   static const double TWO_PI = (2.0*PI);
>   static const double HALF_PI = (M_PI_2);
>   static const double QUARTER_PI = (M_PI_4);
> };

However strange it may seem, this is not valid C++.

See http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00043.html

Paolo

-- 


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


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

end of thread, other threads:[~2005-09-29  8:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-17  9:41 [Bug c++/23437] New: error: ... cannot appear in a constant-expression jmihalicza at graphisoft dot com
2005-08-17  9:44 ` [Bug c++/23437] " jmihalicza at graphisoft dot com
2005-08-17  9:44 ` jmihalicza at graphisoft dot com
2005-08-17  9:45 ` jmihalicza at graphisoft dot com
2005-08-17  9:45 ` jmihalicza at graphisoft dot com
2005-08-17  9:51 ` jmihalicza at graphisoft dot com
2005-08-17 10:17 ` jmihalicza at graphisoft dot com
2005-08-17 11:51 ` [Bug c++/23437] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-08-17 22:13 ` giovannibajo at libero dot it
2005-08-17 22:33 ` giovannibajo at libero dot it
2005-08-19 18:09 ` giovannibajo at libero dot it
2005-09-04 21:36 ` raghavan at cavs dot msstate dot edu
2005-09-05 23:28 ` giovannibajo at libero dot it
2005-09-08 20:33 ` may at cavs dot msstate dot edu
2005-09-12 18:39 ` pannuri at cavs dot msstate dot edu
2005-09-12 20:45 ` pinskia at gcc dot gnu dot org
2005-09-27 16:23 ` mmitchel at gcc dot gnu dot org
2005-09-29  8:30 ` bonzini at gcc dot gnu dot org
2005-09-29  8:34 ` bonzini 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).