Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Gerd_K_
Beginner
84 Views

Invalid handling of newlines in raw string literals

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
84 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
84 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
84 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?

84 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

84 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
84 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
84 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