Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Possible bug: incorrect member value

$
0
0

This program prints 0, when it, clearly, should print 11.

#include <stdio.h>

struct S0 {
    int t = 11;
};

struct S2 : virtual S0 {
};

S2 g_1[1];

int main(int argc, char* argv[])
{
    printf("%d", g_1[0].t);
}

This code compiled with the follow command on windows:

iclvars.bat intel64 & icl file.cpp /w /link /out:file.exe

Version:

Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.3.207 Build 20160415

 

Zone: 

Thread Topic: 

Bug Report

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>