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++/54021] [c++0x] __builtin_constant_p should be constexpr


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

David Stone <david at doublewise dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david at doublewise dot net

--- Comment #5 from David Stone <david at doublewise dot net> 2012-09-08 21:36:10 UTC ---
I'm running into some issues with this bug, and it's much broader than the test
cases suggest. On gcc 4.7.0, this is what happens:

int main() {
    int x = 0;
    // This assigns false to a:
    bool const a = __builtin_constant_p(x);
    // This assigns true to b:
    bool const b = __builtin_constant_p(__builtin_constant_p(x));
    // This causes "error: the value of 'x' is not usable in a constant
expression"
    constexpr bool c = __builtin_constant_p(x);
}


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