× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Hi Kelly,

On V7R3 release, C++11 feature 'Right angle bracket' is enabled by C++
compiler when option -qlanglvl=extended0x is specfied.

I notice that your example code uses another C++11 feature 'Range-based for
loop' ('for (int i : v)') which is not supported by C++ compiler.

After the for loop is commented, I can get successful compile on my 7.3
system. I do not know why you failed to compile with
'-qlanglvl=extended0x'. Do you have PTF SI59548 installed on your system?
If not, please install it or the latest C++ compiler PTF SI63050 and try
compile again.

I am also not sure about why you did not get compiler messages on the
screen with "-qstdlogmsg". I can get compiler messages with
'-qlanglvl=extended' on my 7.3 system, like below.

ixlc -oQTEMP/TEST -qlanglvl=extended -qstdlogmsg -qprint test.cpp
The compilation failed.
/home/renqian/rightanglebracket/test.cpp Line 000023 SUGGESTION: Try
using "-
qlanglvl=rightanglebracket". It looks like you are trying to use the
associat
ed C++0x feature.
/home/renqian/rightanglebracket/test.cpp Line 000023 The text ">>" is
unexpec
ted.

The diagnostic messsage is a little misleading. Option
'-qlanglvl=rightanglebracket' is not supported by the compiler. You can
pass it by using compiler service option
-qcsopt='-qlanglvl=rightanglebracket'. But this is not a suggested way and
it is not guaranteed that the compiler works properly. We suggest to use
option '-qlanglvl=extended0x' to enable the supported C++11 features.

Thanks.

Qian Ren (Jarod)




From: Kelly Beard <kenverybigliar@xxxxxxxxx>
To: "Bare Metal Programming IBM i (AS/400 and iSeries)"
<C400-L@xxxxxxxxxxxx>
Date: 03/24/2017 03:38 AM
Subject: [C400-L] C++0x, V7R3, ixlc
Sent by: "C400-L" <c400-l-bounces@xxxxxxxxxxxx>



Trying out some stuff on V7R3 and ixlc. Notice that I am coding a double
vector thusly:

vector<vector<int>> v2;

Under an older compiler, you'll get barked at for not spacing ">>" like ">
". I compiled with :
ixlc -+ -oBEAK/XXX -qlanglvl=extended0x -qstdlogmsg -qprint yourmom.cpp

I simply get "Compilation failed." (Shouldn't I be getting compiler
messages to the screen with "-qstdlogmsg"?)

In any case, the helpful joblog says:
SUGGESTION: Try using "-qlanglvl=rightanglebracket". It looks like you are
trying to use the associated C++0x
feature.


So, I try
ixlc -+ -oBEAK/XXX -qlanglvl=extended0x -qstdlogmsg -qprint
-qlanglvl=rightanglebracket yourmom.cpp

then get
INVALID COMPILING OPTIONS:-qlanglvl=rightanglebracket

:-(

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <unistd.h>

using namespace std;


class yourmom {
public :
operator string() const {
return "your mom";
}
};


int main(int argc, char* argv[])
{
yourmom c;
int i = 666;
auto x = i;
vector<int> v;
vector<vector<int>> v2;

v.push_back(111);
v.push_back(222);
v.push_back(333);
v.push_back(444);

string s = c;
cout << s << endl;
cout << "i=" << i << endl;
cout << "x=" << x << endl;
cout << "i + x=" << i + x << endl;
for (int i : v) {
cout << i << endl;
}
}


--
Kelly Beard
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L)
mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.