http://llvm.org/bugs/show_bug.cgi?id=11297
Bug #: 11297
Summary: Bad diagnostic for range for loop with non-declaration
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++0x
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
$ cat test.cc
#include <map>
#include <tuple>
#include <string>
int foo(const std::map<std::string, int>& foo) {
std::string key;
int value = 0;
for ( std::tie(key, value) : foo ) {
}
return value;
}
$ clang++ -stdlib=libc++ -std=c++0x -c test.cc
test.cc:8:32: error: expected ';' in 'for' statement specifier
for ( std::tie(key, value) : foo ) {
^
test.cc:8:32: error: expected expression
2 errors generated.
This should say something like "for-range-declaration must be a declaration",
with the whole non-declaration underlined. Complaining about the missing
semicolon is particularly strange since valid range-based for loops don't need
a semicolon.
--
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