[LLVMbugs] [Bug 11297] Bad diagnostic for range for loop with non-declaration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 20 14:56:45 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11297

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|                            |FIXED

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> 2011-12-20 16:56:45 CST ---
As of r147006, we now produce:

test/Parser/cxx0x-for-range.cpp:24:18: error: for range declaration must
declare
      a variable
  for (tie(p, n) : m) {
       ~~~~~~~~~ ^

I do wonder whether we should propose an extension to allow a "for (expression
: expression)" form of the for-range-statement. Cases like this give me pause:

template<typename In, typename Out>
Out copy(In I, In IEnd, Out O) {
  for (*O++ : range(I, IEnd));
  return O;
}

-- 
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.



More information about the llvm-bugs mailing list