术语“函数声明”在 §7/9 (N4140) 中定义,但未定义为语法产生式。为什么?

The term `function declaration` is defined in §7/9 (N4140), but it isn't defined as a grammar production. Why?

在 §7/9 中,您将找到 函数声明 的定义:

If the decl-specifier-seq contains no typedef specifier, the declaration is called a function declaration if the type associated with the name is a function type (8.3.5) and an object declaration otherwise.

在§7/1中你可以找到语法产生式声明的定义,但是没有指定函数声明在那里,作为这个定义的一部分。换句话说,如何在 C++ 语法中对 function declaration 进行分类?

由于该段讨论了 init-declarators,我将其应用于 simple-declaration,其中有一个 初始化声明符列表。你可以看到这并不完全正确

// clearly, this is not the declaration of an object, so it should
// not be called an "object declaration", but 7p9 does say so
int &a = x;

struct A {
   // AFAICS 7p9 should also apply here, but there is no init-declarator
   // here, but a member-declarator. 9.2 also doesn't delegate to 7p9.
   typedef int a;
};

结果是下面也包含函数声明,但该声明声明的不是函数。

template<typename T> void f();

总而言之,我认为规范中需要对此文本进行一些澄清。