Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7679 Discussions

Invalid handling of newlines in raw string literals

Gerd_K_
Beginner
182 Views

Given the following test code compiled with Intel C++ Compiler XE 14.0

#include "stdafx.h"
#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    auto raw = LR"(1
2)";
    
    std::wcout << raw << endl;
    return 0;
}

the actual output on the console is

1\n2

expected output

1
2

Is this a bug in the compiler?

0 Kudos
7 Replies
Shenghong_G_Intel
182 Views

Hi Gerd,

It works for me with 15.0 compiler, did you try that?

Intel(R) C++ Compiler XE for applications running on IA-32, Version 15.0.1.148 B
uild 20141023

# type test.cpp
#include <iostream>

using namespace std;

int main()
{
    auto raw = LR"(1
2)";

    std::wcout << raw << endl;
    return 0;
}
# icl test.cpp /nologo
test.cpp

# test.exe
1
2

#

Thanks,

Shenghong

Gerd_K_
Beginner
182 Views

I can confirm, it is working in 15.0. But because of other problems with 15.0 it's currently not possible for us to upgrade.

I wonder how such a basic usecase for raw string literals hasn't been fixed in any update.

Kittur_G_Intel
Employee
182 Views

Hi Shenghong,  I presume you filed an issue with the developers just in case they would like to backport the fix to earlier versions?

Shenghong_G_Intel
182 Views

Hi Gerd/Ganesh,

Yes, I'll check with developer whether we can backport the fix to earlier versions. I did not tested v14.0 yesterday (I'll verify it soon). I agree such basic stuff should be fixed in old versions and I assume it is not technically difficult to fix.

I'll keep you updated.

Thanks,

Shenghong

Shenghong_G_Intel
182 Views

Hi Gerd,

I've got updates from developer, there are no new update for v14.0, it cannot be back-port to v14.0 compiler. You have to upgrade to v15.0, what are the other problems you are facing with v15.0? You may push those issues to be fixed and have a upgrade.

Thanks

Shenghong

Gerd_K_
Beginner
182 Views

The other issues we had seem to be not caused by the compiler upgrade. It seems to be caused by a bug in an external component that unfortunateley showed up when we tried the upgrade to v 15.

So we will upgrade to v15 in near future.

Kittur_G_Intel
Employee
182 Views

Thanks Shenghong for checking with the developer. Upgrading to 15.0 (especially considering there are new features/bug fixes) is a good idea Gerd.

_KIttur

Reply