[cfe-dev] Injected class name
Sebastian Redl
sebastian.redl at getdesigned.at
Mon Jun 14 12:34:02 PDT 2010
On Mon, 14 Jun 2010 15:27:01 +0100, "Renato Golin" <renato.golin at arm.com>
wrote:
>
> Why does clang refuse this case?
>
> $ clang -c injected.cpp
>
> injected.cpp:7:29: error: cannot compile this global variable that binds
> reference to a non-lvalue yet
>
> const class Class &object = 0;
>
> ^
>
> 1 error generated.
>
> As far as I understand, chapter 9 (paragraph 2) of the (C++03) standard
> allows you to do that. Other compilers, such as G++, understand it
without
> problems.
>
I direct your attention to the word "yet" in the error message. In other
words, it's simply something that isn't yet implemented. Or perhaps it
would actually work, but we forgot to remove the error message.
Sebastian
More information about the cfe-dev
mailing list