[LLVMbugs] [Bug 17649] New: regression in r193073
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Oct 22 04:13:29 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=17649
Bug ID: 17649
Summary: regression in r193073
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: mrmocool at gmx.de
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
http://llvm-reviews.chandlerc.com/D1762
gcc (v4.8.1, Ubuntu 13.10) does indeed reject
for ( ; ({ if (first) { first = 0; continue; } 0; }); )
but it still accepts Qt 4.8.4's foreach (which seems to be the same in Qt 5.2).
Clang now rejects even the most basic use of that.
Please clarify if it needs to be changed in clang, g++ or Qt.
It seems like the semantics of this extension aren't all that clear:
http://gcc.gnu.org/ml/gcc-help/2013-07/msg00155.html
Here's the partially preprocessed code:
#include <vector>
#include <iostream>
template <typename T>
class QForeachContainer
{
public:
inline QForeachContainer(const T& t)
: c(t), brk(0), i(c.begin()), e(c.end())
{
}
const T c;
int brk;
typename T::const_iterator i, e;
};
int main()
{
std::vector<int> v(10);
for (QForeachContainer<__typeof__(v)> _container_(v);
!_container_.brk && _container_.i != _container_.e;
__extension__({ ++_container_.brk; ++_container_.i; })
)
for (int val = *_container_.i;
;
__extension__({--_container_.brk; break; })
)
std::cout << val << " ";
}
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131022/85912389/attachment.html>
More information about the llvm-bugs
mailing list