This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82763] New: std::is_pod works incorrectly with volatile
- From: "jpakkane at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Oct 2017 18:36:33 +0000
- Subject: [Bug c++/82763] New: std::is_pod works incorrectly with volatile
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82763
Bug ID: 82763
Summary: std::is_pod works incorrectly with volatile
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jpakkane at gmail dot com
Target Milestone: ---
The following program prints "is_pod 1":
#include <iostream>
#include <type_traits>
#include <cstdint>
typedef struct
{
int64_t dt_us;
} __attribute__ ((packed)) mytime_t ;
struct MyTimeDate
{
volatile mytime_t mytime;
};
int main(int argc, const char *argv[])
{
std::cout << "is_pod " << std::is_pod<MyTimeDate>::value << std::endl;
return 0;
}
However Clang prints "is_pod 0". Originally this was filed as a bug in Clang
here:
https://bugs.llvm.org/show_bug.cgi?id=35076
However that bug has a long explanation on why Clang is doing the right thing
and that Gcc behaves incorrectly.