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/38354] Spurious error: initializer element is not computable at load time


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38354

--- Comment #7 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Mon, 8 Sep 2014, adam at consulting dot net.nz wrote:

> 3. To demonstrate this, a GNU extension to C++ has no problem computing the
> address of the function pointer at load time and storing it in a 32-bit integer
> array.

Standard C++ allows static initializers that can only be computed at 
runtime; there's no such thing as an initializer being invalid for C++ 
because it's non-constant.  Thus, it's not significant that this code is 
accepted for C++; quite likely the initializers get computed at runtime in 
the C++ case.


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