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

            Bug ID: 126420
           Summary: Rejects valid? deducing return type with expansion
                    statement (empty)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: c++26, rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
auto f() {
  template for (auto x : {}) {
    return 3;
  }
  return 1.3;
}
```

I (and others) assumed that if the expansion statement is not expanded, then
the return value is not checked,  But it seems like GCC checks it always.

Note this is forwarded from https://github.com/llvm/llvm-project/issues/212086
and clang has the same issue and there might be a core issue coming out of it.
Filing it ahead of time just in case.

Reply via email to