When reading [expr.prim.id], one will see that
An id-expression that denotes a non-static data member or non-static member function of a class can only be used:
- if that id-expression denotes a non-static data member and it appears in an unevaluated operand.
The fact that the bullet above applies only to data members is unclear to me. Intuitively I'd expect the following to be well formed:
#include <type_traits>
using func = int();
class bar {
func foo; // This is valid, and not the subject of the question
};
static_assert(std::is_same<decltype(bar::foo), func>::value, "No Symmetry!");
But the decltype() is ill-formed even before the static assertion is checked.
Is there some ambiguity I'm missing?