http://llvm.org/bugs/show_bug.cgi?id=11358
Bug #: 11358
Summary: fails to suggest missing "typename" before type
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
This is not clearly a dupe for bug 8446 even though that bug is also about poor
recovery on a missing "typename" keyword. Here's the testcase:
template<typename T>
struct container {
class iterator {};
iterator begin() { return iterator(); }
};
template<typename T>
struct Test {
typedef container<T> Container;
void test() {
Container::iterator i = c.begin();
}
Container c;
};
Because typedef "Container" is templated, we need a typename in order to write
"Container::iterator". Instead, clang says this:
nlewycky@ducttape:~$ llvm/Debug+Asserts/bin/clang b5411298.cc
b5411298.cc:11:24: error: expected ';' after expression
Container::iterator i = c.begin();
^
;
b5411298.cc:11:25: error: use of undeclared identifier 'i'
Container::iterator i = c.begin();
^
2 errors generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs