gcc 4.5 in c++0x mode rejects the following valid code: std::vector<int> vec; decltype(vec)::value_type v = vec.first(); Per the DR above, decltype can be used with the :: operator. This is similar to a bug report that someone posted for version 3.1, but my experience is with 4.5.
Yes your experience is with 4.5.0 but there is no reason to file a new bug about a known issue. I don't know if the C++ defect report 743 have been voted on yet or not (if not then PR 6709 is suspended because we don't know the final decision of the standards committee). *** This bug has been marked as a duplicate of 6709 ***