braced-init-list in ranged for loop is not supported (C++11)?

braced-init-list in ranged for loop is not supported (C++11)?

Hi, according C++11 specification (in my case I refer to draft n3376) the following 'for' construction is valid:

#include <iostream>
int main(void) {
    for (auto x : { 0, 1, 2 }){
        std::cout << x;

But trying to compile it with intel c++ compiler gives me error:

main.cpp(3): error : assertion failed at: "shared/cfe/edgcpfe/il.c", line 15066

I have installed the following compiler: Intel® C++ Composer XE 2013 SP1 Update 2 Integration for Microsoft* Visual Studio* 2013, Version 14.0.1290.12

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Andrey,


i have Your sample compile under openSUSE 13.2 Linux no probems on compile and execute see output:

linux-cuda60:/system_programming/projects # icpc -m64 -std=c++11 testicc.c                                                                     
linux-cuda60:/system_programming/projects # icpc -m64 -std=c++11 testicc.c -o test1                                                            
linux-cuda60:/system_programming/projects # ./test1                                                                                            
012linux-cuda60:/system_programming/projects #   

icpc (ICC) 14.0.2 20140120                                                                                                                     
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.         this is my compiler version






Best Reply


With the Intel® Composer XE 2015 Beta we have full C++11 support now. Would you like to try it out?

On Linux we have support for initializer lists with g++ 4.4. So - as Franz mentions - the Intel Composer XE 2013 SP1 compiles on openSUSE 13.2 which is g++ 4.8 based.

By the way: Which is your serial number of the Intel C++ Composer XE v14.0? You can answer via "Send Author A Message". Thanks!

Regards, Hubert.

If I understand the right way, the Intel Composer XE 2013 SP1 for windows should be based on MSVC, but MSVC12 also support initializer_list, and can compile the example above


Yes, the MSVC12 compiles the code. The Intel compiler is based on MSVC since we do not have our own standard libraries and a linker.

Does this answer your question?


Yes, with the Intel® Composer XE 2015 Beta it works fine, thank you.

Leave a Comment

Please sign in to add a comment. Not a member? Join today