This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
namespace ns { typedef int III; } int main(int argc, char** argv) { for (typename ns::III i = 0; i < argc; ++i) { // "i" is unresolved puts("%s", argv[i]); // "i" is unresolved } return 0; }
One more typename-related issue found in Loki: return associations_.insert( typename IdToProductMap::value_type(id, creator)).second != 0; // value_type is not resolved Without "typename" it resolves correctly.
*** Issue 144893 has been marked as a duplicate of this issue. ***
Here is a better example (that does compile) iter in for loop is unresolved, while on the next line is ok. template<class K, class V> class normal_iterator { }; template<class K, class V> class AssocVector { public: typedef normal_iterator<K, V> iterator; }; template<class AbstractProduct, typename IdentifierType> class Factory { typedef AssocVector<IdentifierType, AbstractProduct> IdToProductMap; void foo() { for(typename IdToProductMap::iterator iter; ;) { // iter is unresolved } typename IdToProductMap::iterator iter; // ok } };
Fix + test: http://hg.netbeans.org/main/rev/f019f94e85fe
Integrated into 'main-golden', available in build *200808280201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/f019f94e85fe User: Alexey Vladykin <alexey_vladykin@netbeans.org> Log: Fixed IZ#144363: typename in for-loop leads to unresolved identifier error