This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/46472] [4.6 Regression] [C++0X] constexpr is not constexpr


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.02.17 20:25:58
            Summary|[C++0X] constexpr is not    |[4.6 Regression] [C++0X]
                   |constexpr                   |constexpr is not constexpr
     Ever Confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-17 20:25:58 UTC ---
Marc provided this testcase demonstrating a regression since 4.5
(probably in G++ but possibly libstdc++, a regression either way)

#include <utility>
#include <array>
struct A {
       A(){}
};
std::array< std::pair<int,A>, 2> x;


In file included from c.cc:2:0:
/home/redi/gcc/4.x/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/array:
In constructor âconstexpr std::array<std::pair<int, A>, 2ul>::array()â:
/home/redi/gcc/4.x/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/array:60:12:
error: âconstexpr std::pair<_T1, _T2>::pair() [with _T1 = int, _T2 = A]â is not
âconstexprâ
/home/redi/gcc/4.x/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/array:60:12:
error: non-constant array initialization
c.cc: At global scope:                                                          
c.cc:6:34: note: synthesized method âstd::array<std::pair<int, A>,
2ul>::array()â first required here


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]