c++ - inline in block scope function declaration -


what following means?

iso/iec 14882:2011

7.1.2 function specifiers [dcl.fct.spec] ...
3 ... inline specifier shall not appear on block scope function declaration.

is smth invalid according quote or not?

#include <iostream>  int main() {     inline void foo();     foo(); }  void foo() {     std::cout << "::foo() \n"; } 

gcc compiles without error.

am wrong or not?

is smth invalid according quote or not?

yes, in invalid because of standard paragraph quote in question's text.

the fact compiler accepts may either bug or documented extension, not conforming c++11 standard.

additional information:

when try compile above program gcc 4.7.2, warning says:

warning: 'inline' specifier invalid function 'foo' declared out of global scope [-pedantic]


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -