non-class rvalues always have cv-unqualified types

前端 未结 2 1867
有刺的猬
有刺的猬 2020-11-27 04:45

§3.10 section 9 says \"non-class rvalues always have cv-unqualified types\". That made me wonder...

int foo()
{
    return 5;
}

const int bar()
{
    return         


        
2条回答
  •  爱一瞬间的悲伤
    2020-11-27 05:32

    The committee already seems to be aware that there's a problem in this part of the standard. CWG issue 690 talks about a somewhat similar problem with exactly the same part of the standard (in the "additional note" from September, 2009). I'd guess new language will be drafted for that part of the standard soon.

    Edit: I've just submitted a post on comp.std.c++, noting the problem and suggesting new wording for the relevant piece of the standard. Unfortunately, being a moderated newsgroup, nearly everybody will probably have forgotten this question by the time it makes it through the approval queue there.

提交回复
热议问题