https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86870

            Bug ID: 86870
           Summary: Declaration disambiguation is too greedy
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blitzrakete at gmail dot com
  Target Milestone: ---

struct X {
  void operator=(int);
} x;

int main() {
  1 + 1, X(x) = 4; // ok
  X(x) = 4, 1 + 1; // gcc fails
}

gcc cannot compile the second statement, because it thinks it is a declaration,
even though it is not. EDG compiles this just fine (clang and MSVC do not).

Reply via email to