public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13969] New: static const value rejected as template parameter
@ 2004-02-02  0:11 rwgk at yahoo dot com
  2004-02-02  0:13 ` [Bug c++/13969] " rwgk at yahoo dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rwgk at yahoo dot com @ 2004-02-02  0:11 UTC (permalink / raw)
  To: gcc-bugs

gcc-3_4-branch from 2004/02/01, ca. 12:00pm PST
Configured with: ../gcc-3_4-branch/configure --prefix=/usr/local_cci/gcc-3_4-
branch_2004_02_01_1211 --enable-languages=c,c++
Redhat Linux 8.0

% g++ -fPIC -ftemplate-depth-120 -w -DNDEBUG -O3 -DBOOST_PYTHON_MAX_BASES=2 -
Iinclude -I/net/worm/scratch1/rwgk/rc1310/include -
I/net/worm/scratch1/rwgk/rc1310/cctbx/include -
I/net/worm/scratch1/rwgk/rc1310/scitbx/include -
I/net/worm/scratch1/rwgk/rc1310/boost -I/usr/include/python2.2 -
E /net/worm/scratch1/rwgk/rc1310/cctbx/xray/boost_python/fast_gradients.cpp > 
fast_gradients_pp.cpp

% g++ -fPIC -ftemplate-depth-120 -w -DNDEBUG -O3 -c fast_gradients_pp.cpp |& 
head
In file included 
from /net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/fast_gradients.h:4,
                 
from /net/worm/scratch1/rwgk/rc1310/cctbx/xray/boost_python/fast_gradients.cpp:3
:
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h:361: 
error: non-constant 
`cctbx::xray::detail::gaussian_fourier_transformed<FloatType>::max_n_rho_real_te
rms' cannot be used as template argument
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h:361: 
error: ISO C++ forbids declaration of `as_real_' with no type
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h:362: 
error: non-constant 
`cctbx::xray::detail::gaussian_fourier_transformed<FloatType>::max_n_rho_real_te
rms' cannot be used as template argument
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h:362: 
error: ISO C++ forbids declaration of `bs_real_' with no type
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h:364: 
error: non-constant 
`cctbx::xray::detail::gaussian_fourier_transformed<FloatType>::max_n_rho_real_te
rms' cannot be used as template argument
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h:364: 
error: ISO C++ forbids declaration of `aniso_bs_real_' with no type
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h: In 
constructor 
`cctbx::xray::detail::gaussian_fourier_transformed<FloatType>::gaussian_fourier_
transformed(cctbx::xray::detail::exponent_table<FloatType>&, const 
cctbx::eltbx::xray_scattering::gaussian&, const FloatType&, const FloatType&, 
const FloatType&, const FloatType&, const FloatType&)':
/net/worm/scratch1/rwgk/rc1310/cctbx/include/cctbx/xray/sampling_base.h:247: 
error: invalid types `int[size_t]' for array subscript

The same code compiles with many other compilers incl. earlier versions of gcc. 
It also compiled with gcc-3.4.0 from 2004/01/12.

I will attach the preprocessed source code. The same file is also available 
here:

http://cci.lbl.gov/~rwgk/bugs/gcc340/fast_gradients_pp.cpp.gz

-- 
           Summary: static const value rejected as template parameter
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rwgk at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


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


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

* [Bug c++/13969] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
@ 2004-02-02  0:13 ` rwgk at yahoo dot com
  2004-02-02  7:41 ` [Bug c++/13969] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rwgk at yahoo dot com @ 2004-02-02  0:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rwgk at yahoo dot com  2004-02-02 00:13 -------
Created an attachment (id=5639)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5639&action=view)
Preprocessed source, gzipped


-- 


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


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

* [Bug c++/13969] [3.4/3.5 Regression] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
  2004-02-02  0:13 ` [Bug c++/13969] " rwgk at yahoo dot com
@ 2004-02-02  7:41 ` pinskia at gcc dot gnu dot org
  2004-02-02 23:52 ` bangerth at dealii dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-02  7:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-02 07:41 -------
A regression.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
            Summary|static const value rejected |[3.4/3.5 Regression] static
                   |as template parameter       |const value rejected as
                   |                            |template parameter
   Target Milestone|---                         |3.4.0


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


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

* [Bug c++/13969] [3.4/3.5 Regression] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
  2004-02-02  0:13 ` [Bug c++/13969] " rwgk at yahoo dot com
  2004-02-02  7:41 ` [Bug c++/13969] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-02-02 23:52 ` bangerth at dealii dot org
  2004-02-03  5:00 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-02-02 23:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-02 23:52 -------
Confirmed. This looks like a dependent-ness issue. Here's a cut-down: 
-------------- 
struct B { 
    static const int N=10; 
}; 
 
template <int> struct X {}; 
 
template <typename> struct S { 
    static const int N = B::N; 
    X<N> x; 
}; 
 
template class S<float>; 
------------------- 
 
Gcc thinks that S::N is non-dependent, but in fact it is. 
 
This is a regression against 3.3.3. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.4.0 3.5.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-02 23:52:57
               date|                            |


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


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

* [Bug c++/13969] [3.4/3.5 Regression] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
                   ` (2 preceding siblings ...)
  2004-02-02 23:52 ` bangerth at dealii dot org
@ 2004-02-03  5:00 ` pinskia at gcc dot gnu dot org
  2004-02-03  8:27 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-03  5:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-03 05:00 -------
Mark I think this another fall out from you template_parms work.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c++/13969] [3.4/3.5 Regression] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
                   ` (3 preceding siblings ...)
  2004-02-03  5:00 ` pinskia at gcc dot gnu dot org
@ 2004-02-03  8:27 ` pinskia at gcc dot gnu dot org
  2004-02-04 18:16 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-03  8:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-03 08:27 -------
: Search converges between 2004-01-27-trunk (#491) and 2004-01-28-trunk (#492).

-- 


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


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

* [Bug c++/13969] [3.4/3.5 Regression] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
                   ` (4 preceding siblings ...)
  2004-02-03  8:27 ` pinskia at gcc dot gnu dot org
@ 2004-02-04 18:16 ` cvs-commit at gcc dot gnu dot org
  2004-02-04 18:35 ` cvs-commit at gcc dot gnu dot org
  2004-02-04 18:38 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-04 18:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-04 18:16 -------
Subject: Bug 13969

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-02-04 18:16:33

Modified files:
	gcc/cp         : ChangeLog cp-tree.h parser.c pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: static6.C 

Log message:
	PR c++/13969
	* g++.dg/template/static6.C: New test.
	
	PR c++/13969
	* cp-tree.h (fold_non_dependent_expr): New function.
	* parser.c (cp_parser_fold_non_dependent_expr): Remove.
	(cp_parser_template_argument): Use fold_non_dependent_expr.
	(cp_parser_direct_declarator): Likewise.
	* pt.c (fold_non_dependent_expr): New function.
	(convert_nontype_argument): Use it.
	(tsubst_qualified_id): Simplify.
	(tsubst_copy_and_build): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.33&r2=1.3892.2.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.946.4.3&r2=1.946.4.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.9&r2=1.157.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.9&r2=1.816.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.50&r2=1.3389.2.51
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static6.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/13969] [3.4/3.5 Regression] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
                   ` (5 preceding siblings ...)
  2004-02-04 18:16 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-04 18:35 ` cvs-commit at gcc dot gnu dot org
  2004-02-04 18:38 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-04 18:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-04 18:35 -------
Subject: Bug 13969

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-02-04 18:35:19

Modified files:
	gcc/cp         : ChangeLog cp-tree.h parser.c pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: static6.C 

Log message:
	PR c++/13969
	* g++.dg/template/static6.C: New test.
	
	PR c++/13969
	* cp-tree.h (fold_non_dependent_expr): New function.
	* parser.c (cp_parser_fold_non_dependent_expr): Remove.
	(cp_parser_template_argument): Use fold_non_dependent_expr.
	(cp_parser_direct_declarator): Likewise.
	* pt.c (fold_non_dependent_expr): New function.
	(convert_nontype_argument): Use it.
	(tsubst_qualified_id): Simplify.
	(tsubst_copy_and_build): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3932&r2=1.3933
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.949&r2=1.950
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.167&r2=1.168
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.827&r2=1.828
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3468&r2=1.3469
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static6.C.diff?cvsroot=gcc&r1=1.1&r2=1.2



-- 


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


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

* [Bug c++/13969] [3.4/3.5 Regression] static const value rejected as template parameter
  2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
                   ` (6 preceding siblings ...)
  2004-02-04 18:35 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-04 18:38 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-04 18:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-02-04 18:38 -------
Fixed in GCC 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2004-02-04 18:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-02  0:11 [Bug c++/13969] New: static const value rejected as template parameter rwgk at yahoo dot com
2004-02-02  0:13 ` [Bug c++/13969] " rwgk at yahoo dot com
2004-02-02  7:41 ` [Bug c++/13969] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-02-02 23:52 ` bangerth at dealii dot org
2004-02-03  5:00 ` pinskia at gcc dot gnu dot org
2004-02-03  8:27 ` pinskia at gcc dot gnu dot org
2004-02-04 18:16 ` cvs-commit at gcc dot gnu dot org
2004-02-04 18:35 ` cvs-commit at gcc dot gnu dot org
2004-02-04 18:38 ` mmitchel 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).