Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

referencing member of the current instantiation with a deduced return type #17249

Closed
zygoloid mannequin opened this issue Aug 13, 2013 · 3 comments
Closed

referencing member of the current instantiation with a deduced return type #17249

zygoloid mannequin opened this issue Aug 13, 2013 · 3 comments
Labels
bugzilla Issues migrated from bugzilla c++14

Comments

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Aug 13, 2013

Bugzilla Link 16875
Resolution FIXED
Resolved on Aug 14, 2013 17:57
Version trunk
OS Linux
CC @gnzlbg

Extended Description

Clang rejects this:

template struct X {
auto f() { return 0; }
void g() { f(); }
};

saying:

:3:14: error: function 'f' with deduced return type cannot be used before it is defined
void g() { f(); }
^

This isn't right: we should be allowed to reference this function as a member of the current instantiation. We should probably deduce the return type to DependentTy when the template is defined.

@zygoloid
Copy link
Mannequin Author

zygoloid mannequin commented Aug 14, 2013

Fixed in r188410.

@gnzlbg
Copy link
Mannequin

gnzlbg mannequin commented Aug 15, 2013

*** Bug llvm/llvm-bugzilla-archive#16884 has been marked as a duplicate of this bug. ***

@gnzlbg
Copy link
Mannequin

gnzlbg mannequin commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#16884

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++14
Projects
None yet
Development

No branches or pull requests

0 participants