-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Incorrect dependent template name error #17775
Comments
I experienced a similar problem. |
*** Bug llvm/llvm-bugzilla-archive#38299 has been marked as a duplicate of this bug. *** |
mentioned in issue llvm/llvm-bugzilla-archive#38299 |
mentioned in issue llvm/llvm-bugzilla-archive#39047 |
@llvm/issue-subscribers-clang-frontend Author: None (llvmbot)
| | |
| --- | --- |
| Bugzilla Link | [17401](https://llvm.org/bz17401) |
| Version | 3.3 |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor |
Extended DescriptionIn the code shown below, Clang claims that the call to Tested on Clang 3.2 (Ubuntu) and Clang 3.3 (Xcode 5). G++ (4.7, 4.8) does not report an error on this code.
class A {
public:
template <typename T>
T foo();
};
class B {
public:
A bar();
};
template <typename T>
class C {
public:
T baz() {
return b.bar().foo<T>();
}
private:
B b;
};
|
Related bug: #37647 |
Looks fixed in clang10: https://godbolt.org/z/E91qMzf14 |
Extended Description
In the code shown below, Clang claims that the call to
foo
withinC::baz()
is template-dependent and therefore must be prefixed with thetemplate
keyword. I'm not a standards expert, but it does not appear to me to be template-dependent -- the call clearly always resolves toA::foo()
. Moreover, if the type ofC::b
is changed toB*
and the call becomesb->bar().foo<T>()
then no error is reported, which seems pretty suspicious.Tested on Clang 3.2 (Ubuntu) and Clang 3.3 (Xcode 5).
G++ (4.7, 4.8) does not report an error on this code.
The text was updated successfully, but these errors were encountered: