[Bug c++/97663] New: [c++17] Function with return type 'unsigned' in nested namespace misinterpreted as deduction guide
hans.dembinski at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Nov 1 15:07:43 GMT 2020
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
More information about the Gcc-bugs
mailing list