Knowledge Library
Knowledge Library Home Knowledge Library Products Development Tools LLVM Compiler TCLLVM-50 : Clang issues warnings when some C++11 headers are included

TCLLVM-50 : Clang issues warnings when some C++11 headers are included

Defect #: TCLLVM-50
Found In VersionLLVM 3.8.0.1
Severity:Standard
Status:Acknowledged
Created Date:02/16/2017
Component/s :CLANG

Description

When the given test case is compiled with Clang and C++11, the following warnings are printed:

In file included from allHeaders.cpp:17:
In file included from /home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/codecvt:4:
In file included from /home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/locale:5:
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/xlocbuf:330:23: warning: field '_Has_werr' will be initialized after field '_Has_state' [-Wreorder]
                : _Has_berr(false), _Has_werr(false), _Has_state(false)
                                    ^
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/filesystem:705:51: note: in instantiation of member function 'std::wstring_convert<std::codecvt_utf8<wchar_t, 1114111, 0>, wchar_t, std::allocator<wchar_t>, std::allocator<char> >::wstring_convert' requested here
                wstring_convert<codecvt_utf8<_Inchar>, _Inchar> _Wcvt;
                                                                ^
In file included from allHeaders.cpp:17:
In file included from /home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/codecvt:4:
In file included from /home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/locale:5:
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/xlocbuf:336:23: warning: field '_Has_werr' will be initialized after field '_Has_state' [-Wreorder]
                : _Has_berr(false), _Has_werr(false), _Has_state(false)
                                    ^
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/filesystem:656:27: note: in instantiation of member function 'std::wstring_convert<std::codecvt<wchar_t, char, _Mbstatet>, wchar_t, std::allocator<wchar_t>, std::allocator<char> >::wstring_convert' requested here
                wstring_convert<_Mycvt> _Wcvt(&use_facet< _Mycvt >(_Loc));
                                        ^
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/filesystem:1641:4: note: in instantiation of member function 'std::tr2::sys::_Path_cvt<char, char32_t, std::char_traits<char32_t>, std::allocator<char32_t> >::_Cvt' requested here
                        _Cvt(_Str, _Mystr.c_str(), _Mystr.size()));
                        ^
In file included from allHeaders.cpp:41:
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/future:293:3: warning: field '_Running' will be initialized after field '_Ready' [-Wreorder]
                _Running(false),
                ^
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/future:2035:20: note: in instantiation of member function 'std::_Associated_state<int>::_Associated_state' requested here
                : _MyPromise(new _Associated_state<int>)
                                 ^
In file included from allHeaders.cpp:35:
/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11/deque:2008:36: warning: unused typedef '_Blockptr' [-Wunused-local-typedef]
                typedef typename _Alpty::pointer _Blockptr;
                                                 ^
6 warnings generated.

Steps to Reproduce

1. Create a test.cpp file like the following:
/* test.cpp */
#include "algorithm"
#include "array"
#include "atomic"
#include "bitset"
#include "cassert"
#include "ccomplex"
#include "cctype"
#include "cerrno"
#include "cfenv"
#include "cfloat"
#include "chrono"
#include "cinttypes"
#include "ciso646"
#include "climits"
#include "clocale"
#include "cmath"
#include "codecvt"
#include "complex"
#include "condition_variable"
#include "csetjmp"
#include "csignal"
#include "cstdalign"
#include "cstdarg"
#include "cstdbool"
#include "cstddef"
#include "cstdint"
#include "cstdio"
#include "cstdlib"
#include "cstring"
#include "ctgmath"
#include "ctime"
#include "cuchar"
#include "cwchar"
#include "cwctype"
#include "deque"
#include "exception"
#include "filesystem"
#include "forward_list"
#include "fstream"
#include "functional"
#include "future"
#include "hardware"
#include "hash_map"
#include "hash_set"
#include "initializer_list"
#include "iomanip"
#include "ios"
#include "iosfwd"
#include "iostream"
#include "istream"
#include "iterator"
#include "limits"
#include "limits~"
#include "list"
#include "locale"
#include "map"
#include "memory"
#include "mutex"
#include "new"
#include "numeric"
#include "ostream"
#include "queue"
#include "random"
#include "ratio"
#include "regex"
#include "scoped_allocator"
#include "set"
#include "shared_mutex"
#include "slist"
#include "sstream"
#include "stack"
#include "stdexcept"
#include "streambuf"
#include "string"
#include "strstream"
#include "system_error"
#include "thread"
#include "tuple"
#include "typeindex"
#include "typeinfo"
#include "type_traits"
#include "unordered_map"
#include "unordered_set"
#include "utility"
#include "valarray"
#include "vector"

2. Compile the test.cpp file using Clang:
ccllvm --target=arm64 -ftls-model=local-exec -ffixed-x18 -mno-implicit-float -D__RTP__ -ansi -fno-strict-aliasing -D_C99 -D_HAS_C9X -std=c++11 -isystem/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public/c++11 -fno-use-init-array -D__vxworks -D__VXWORKS__ -O2 -fno-builtin -Wall -Wsystem-headers -D_VX_CPU=_VX_ARMARCH8A -D_VX_TOOL_FAMILY=llvm -D_VX_TOOL=llvm -DARMEL -DARMEL -DARM_USE_VFP -DARM_USE_VFP -DINET -DINET6 -D_VSB_CONFIG_FILE="/home/install/ARM64/vxworks-7/workspace/vsb_qsp/h/config/vsbConfig.h" -I/home/install/ARM64/vxworks-7/workspace/vsb_qsp/share/h -isystem/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h -isystem/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/system -isystem/home/install/ARM64/vxworks-7/workspace/vsb_qsp/usr/h/public -c test.cpp

KLID_DEFECT (use as Content ID for linking):  KLID_DEFECT_45829
 
You must to post a comment.
Last modified
20:55, 28 Jun 2017