ICE instead of error message on range-based for-loop misuse

ICE instead of error message on range-based for-loop misuse

imagem de Jascha Wetzel

ICL Version 13.0.1.119 Build 20121008

#include <vector>
int main()
{
    std::vector<int> v;
    for ( auto& x : v.size() )
        ++x;
}

results in
missing_error_message.cpp
missing_error_message.cpp(5): internal error: assertion failed at: "shared/cfe/edgcpfe/overload.c", line 8257
      for ( auto& x : v.size() )
                      ^

Could be a friendlierr error message.

2 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Judith Ward (Intel)

Thank you for reporting this. This is being tracked in our bug database as DPD200239305. It is fixed in our under development compiler so you should see the fix in our next major release. This will be the error message:

!% icl -Qstd=c++11 -c bug.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version Mainline Bet
a Build x
Built Nov 21 2012 19:44:17 by jward4 on JWARD4-DESK in D:/workspaces/45cfe/dev
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.

bug.cpp
bug.cpp(7): error: this range-based "for" statement requires a suitable "begin"
function and none was found
for ( auto& x : v.size() )
^

bug.cpp(7): error: this range-based "for" statement requires a suitable "end" fu
nction and none was found
for ( auto& x : v.size() )
^

compilation aborted for bug.cpp (code 2)

Faça login para deixar um comentário.