Ambiguity Resolution

void S(){}
struct S{};

int main(){
   S();
}

In the above code, the expression "S ()" in main is considered as an expression of a function call, and not an attempt to create a temporary type "S".

What part of the C ++ standard talks about allowing such an expression to favor a function declaration? For some reason I cannot find it.

+3
source share
2 answers

Section 3.3.7 / 2

(9.1) (7.2) , , . , ( ) , , .

3.4.4/1

- - - (3.3.7). - - , .

+5

(::), ( .

0

Source: https://habr.com/ru/post/1772981/


All Articles