Bug 54532 - [C++0x][constexpr] internal error when initializing static constexpr with pointer to non-static member variable
Summary: [C++0x][constexpr] internal error when initializing static constexpr with poi...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.1
: P3 normal
Target Milestone: 4.9.0
Assignee: Jason Merrill
URL:
Keywords:
: 51373 (view as bug list)
Depends on:
Blocks: constexpr
  Show dependency treegraph
 
Reported: 2012-09-09 02:23 UTC by Chris Studholme
Modified: 2014-06-09 20:03 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-09-09 00:00:00


Attachments
output of g++ -v (1.04 KB, text/x-log)
2012-09-09 02:23 UTC, Chris Studholme
Details
preprocessed source (313 bytes, application/octet-stream)
2012-09-09 02:24 UTC, Chris Studholme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Studholme 2012-09-09 02:23:27 UTC
Created attachment 28154 [details]
output of g++ -v

The following code triggers a segfault.

struct reg {
    template <typename CLS, typename T>
    constexpr reg(T CLS::*) {}
};

struct foo {
};

struct bar {
    foo a;

    // both of these trigger internal error
    static constexpr foo bar::*reg_a = &bar::a;
    static constexpr reg reg_a = &bar::a;
};

g++ --version
g++ (Debian 4.7.1-7) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

4.6 seems to have the same problem.
Comment 1 Chris Studholme 2012-09-09 02:24:57 UTC
Created attachment 28155 [details]
preprocessed source
Comment 2 Jonathan Wakely 2012-09-09 12:01:29 UTC
also ICEs on trunk
Comment 3 Jason Merrill 2013-04-01 21:07:42 UTC
Fixed for 4.9.
Comment 4 Jason Merrill 2014-06-09 20:03:49 UTC
*** Bug 51373 has been marked as a duplicate of this bug. ***