Using a hyperlinked C++ grammer, the parsing of
decltype( expression ) decltype( assignment-expression ) decltype( conditional-expression )
... lots of steps involving order of operations go here ...
decltype( postfix-expression ) decltype( simple-type-specifier ( expression-listopt ) ) decltype( void() )
Specifically, quoting section 5.2.3 [expr.type.conf] paragraph 2 of the 2011 ISO C++ standard:
Tis a simple-type-specifier or typename-specifier for a non-array complete object type or the (possibly cv-qualified)
voidtype, creates a prvalue of the specified type, which is value-initialized (8.5; no initialization is done for the
void() is an expression of type
void, just as
int() is an expression of type
int (with value
0). Clearly a void expression has no value, but here it's the operand of
decltype, so it's not evaluated.
decltype refers only to its operand's type, not its value.
decltype(void()) is simply a verbose way of referring to the type