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

            Bug ID: 122199
           Summary: Extern C allowed with Abbreviated function template
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ellxor at proton dot me
  Target Milestone: ---

The following code compiles with no warnings or errors but produces an
assembler error. The expected output would be to produce the same error as
combining extern "C" with an explicit template.

Code:
```
// test.cc

extern "C" auto f(auto x) { return x + 1; }

int g(int x) {
        return f(x);
}

float h(float x) {
        return f(x);
}
```

Command:
```
g++ -std=c++20 -Wall -Wextra -pedantic -c test.cc
```

Output:
```
/tmp/ccy1HBxr.s: Assembler messages:
/tmp/ccy1HBxr.s:49: Error: symbol `f' is already defined
```

GCC version: 15.2.0

Reply via email to