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++/49172] New: [C++0x][constexpr] References should be declarable with constexpr


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

           Summary: [C++0x][constexpr] References should be declarable
                    with constexpr
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com
                CC: jason@redhat.com


This is a reminder entry to realize the FDIS change, that references can now be
declared as constexpr (7.1.5 p9).

gcc 4.7.0 20110521 (experimental) in C++0x mode rejects the following code with
errors at the positions #1 and #2:

//---
void g() {};

constexpr void(&rg)() = g; // #1

int i;

constexpr int const& ri = i; // #2
//---

"error: 'const' qualifiers cannot be applied to 'void (&)()'|
error: 'const' qualifiers cannot be applied to 'const int&'"

This code should be accepted.


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