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

            Bug ID: 97663
           Summary: [c++17] Function with return type 'unsigned' in nested
                    namespace misinterpreted as deduction guide
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hans.dembinski at gmail dot com
  Target Milestone: ---

g++ with -std=c++17 since version 7.1 up to current trunk misdetects 'bar::foo'
the following code as a deduction guide for 'struct foo':

```
template <class T> struct foo {};

namespace bar {

unsigned foo();

}
```

Code on Godbolt: https://godbolt.org/z/6E4efY

Workarounds:
- Use 'unsigned int foo()'
- Use 'auto foo() -> unsigned'.

Related issue with more context:
https://github.com/boostorg/histogram/issues/290

Reply via email to