Bug 1403093 - ppl C++ interface uses typeof instead of decltype
Summary: ppl C++ interface uses typeof instead of decltype
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ppl
Version: 26
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Roberto Bagnara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-09 02:56 UTC by Jerry James
Modified: 2017-03-03 17:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-03 17:16:41 UTC
Type: Bug


Attachments (Terms of Use)

Description Jerry James 2016-12-09 02:56:39 UTC
Description of problem:
Consider this program, in pplver.cpp:

#include <cstddef>
#include "ppl.hh"
#include <iostream>
int main() {
   Parma_Polyhedra_Library::C_Polyhedron dummy;
   std::cout << PPL_VERSION_MAJOR << "." << PPL_VERSION_MINOR << "." << PPL_VERSION_REVISION;
   return 0;
}

On an F-25 or Rawhide machine, compile it with 'g++ -std=c++11 -o pplver pplver.cpp -lppl -lgmp'.  The result is a series of errors, starting with this one:

In file included from /usr/include/ppl.hh:25:0,
                 from test.cpp:2:
/usr/include/ppl-x86_64.hh:10677:29: error: typedef ‘Parma_Polyhedra_Library::Checked::typeof’ is initialized (use decltype instead)
 typedef typeof(__mpz_struct()._mp_size) mp_size_field_t;

With C++11 or C++14, decltype has to be used instead of typeof.  Add '-Dtypeof(x)=decltype(x)' to the compiler flags and the build succeeds.

Version-Release number of selected component (if applicable):
ppl-1.1-14.fc25.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Try to build ppl-using code with -std=c++11 or -std=c++14
2.
3.

Actual results:
The errors reported above.

Expected results:
A clean build.

Additional info:
PPL version 1.2 has a fix for this bug.

Comment 1 Fedora End Of Life 2017-02-28 10:45:20 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Jerry James 2017-03-03 17:16:41 UTC
PPL 1.2 has been built for Rawhide and F-26, fixing this bug.


Note You need to log in before you can comment on or make changes to this bug.