"extern string-literal declaration" 在功能范围内

"extern string-literal declaration" within function scope

来自 [dcl.link]#2 :

extern string-literal declaration

该段落没有指定函数范围内声明的任何特殊情况,但以下内容也不会编译:

void foo () { extern "C" int boo () ; }

来自 g++ 输出:

error: expected unqualified-id before string constant

这是 g++ 的错误还是我遗漏了什么?

linkage-specification is part of declaration which is part of declaration-seq which can be part of a namespace-body or a translation-unit.

语法中不允许在使用 block-declaration 的函数中使用它,这与 声明 几乎相同,但值得注意的是缺少 链接规范.