Help: compiler's error using -stdlib=libc++ with clang++-3.8

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev
Hello CFE list

Sorry to post again this post, but I am really stacked on this problem.

I have an issue compiling a small c++ program with clang++-3.8 on Ubuntu trusty

Using the joined c++ program bug.cpp,
  • clang++-3.8 -std=c++11 bug.cpp compiles fine while
  • clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid compile errors.

What could be the problem and how can it be solved?

TIA

fandre@ubuntu-trusty-64:~/clang$ uname -a
Linux ubuntu-trusty-64 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 --version
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Below is the console log

fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$ cp bug.cpp ../shared
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

bug.cpp (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev
Based on the errors, I would guess that the offsetof macro is not defined. Maybe there's something wrong with your include path?

On 22 Jul 2017 3:54 am, "zosrothko via cfe-dev" <[hidden email]> wrote:
Hello CFE list

Sorry to post again this post, but I am really stacked on this problem.

I have an issue compiling a small c++ program with clang++-3.8 on Ubuntu trusty

Using the joined c++ program bug.cpp,
  • clang++-3.8 -std=c++11 bug.cpp compiles fine while
  • clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid compile errors.

What could be the problem and how can it be solved?

TIA

fandre@ubuntu-trusty-64:~/clang$ uname -a
Linux ubuntu-trusty-64 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 --version
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Below is the console log

fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$ cp bug.cpp ../shared
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev



Le 22/07/2017 à 15:07, Richard Smith a écrit :
Based on the errors, I would guess that the offsetof macro is not defined. Maybe there's something wrong with your include path?
Thanks for answering, but this code compiles fine with this command below, thus I do not understand your point on the include path? (there is no private includes in this code)

clang++-3.8 -std=c++11 bug.cpp

On 22 Jul 2017 3:54 am, "zosrothko via cfe-dev" <[hidden email]> wrote:
Hello CFE list

Sorry to post again this post, but I am really stacked on this problem.

I have an issue compiling a small c++ program with clang++-3.8 on Ubuntu trusty

Using the joined c++ program bug.cpp,
  • clang++-3.8 -std=c++11 bug.cpp compiles fine while
  • clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid compile errors.

What could be the problem and how can it be solved?

TIA

fandre@ubuntu-trusty-64:~/clang$ uname -a
Linux ubuntu-trusty-64 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 --version
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Below is the console log

fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$ cp bug.cpp ../shared
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev
In reply to this post by Sumner, Brian via cfe-dev
On Sat, Jul 22, 2017 at 09:54:03AM +0200, zosrothko via cfe-dev wrote:
>  * clang++-3.8 -std=c++11 bug.cpp compiles fine while
>  * clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid
>    compile errors.

Missing include of <cstddef>?

Joerg
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev


Le 22/07/2017 à 19:26, Joerg Sonnenberger a écrit :
> On Sat, Jul 22, 2017 at 09:54:03AM +0200, zosrothko via cfe-dev wrote:
>>   * clang++-3.8 -std=c++11 bug.cpp compiles fine while
>>   * clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid
>>     compile errors.
> Missing include of <cstddef>?
Not really , it is included...below the first five lines of bug.cpp
#include <iostream>
#include <cstddef>
#ifdef Header
#undef Header
#endif
>
> Joerg

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev
In reply to this post by Sumner, Brian via cfe-dev
On 22 Jul 2017 12:52 pm, "zosrothko via cfe-dev" <[hidden email]> wrote:



Le 22/07/2017 à 15:07, Richard Smith a écrit :
Based on the errors, I would guess that the offsetof macro is not defined. Maybe there's something wrong with your include path?
Thanks for answering, but this code compiles fine with this command below, thus I do not understand your point on the include path? (there is no private includes in this code)

clang++-3.8 -std=c++11 bug.cpp


Include path problems can show up with -stdlib=libc++ because it changes the include path, and because libc++ makes different use of #include_next than libstdc++. Please add -v to the failing command and tell us the include path that is printed.
On 22 Jul 2017 3:54 am, "zosrothko via cfe-dev" <[hidden email]> wrote:
Hello CFE list

Sorry to post again this post, but I am really stacked on this problem.

I have an issue compiling a small c++ program with clang++-3.8 on Ubuntu trusty

Using the joined c++ program bug.cpp,
  • clang++-3.8 -std=c++11 bug.cpp compiles fine while
  • clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid compile errors.

What could be the problem and how can it be solved?

TIA

fandre@ubuntu-trusty-64:~/clang$ uname -a
Linux ubuntu-trusty-64 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 --version
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Below is the console log

fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$ cp bug.cpp ../shared
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev
Le 23/07/2017 à 18:34, Richard Smith a écrit :
On 22 Jul 2017 12:52 pm, "zosrothko via cfe-dev" <[hidden email]> wrote:



Le 22/07/2017 à 15:07, Richard Smith a écrit :
Based on the errors, I would guess that the offsetof macro is not defined. Maybe there's something wrong with your include path?
Thanks for answering, but this code compiles fine with this command below, thus I do not understand your point on the include path? (there is no private includes in this code)

clang++-3.8 -std=c++11 bug.cpp


Include path problems can show up with -stdlib=libc++ because it changes the include path, and because libc++ makes different use of #include_next than libstdc++. Please add -v to the failing command and tell us the include path that is printed.
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -v -stdlib=libc++ bug.cpp
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.1.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.1.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/usr/lib/llvm-3.8/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name bug.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0 -internal-isystem /usr/include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/fandre/clang -ferror-limit 19 -fmessage-length 158 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/bug-10e224.o -x c++ bug.cpp
clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/v1
 /usr/local/include
 /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_static_assert_typedef_53 __attri...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_static_assert_typedef_53 __attri...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_static_assert_typedef_53 __attri...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_static_assert_typedef_54 __a...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_static_assert_typedef_54 __a...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_static_assert_typedef_54 __a...
                                                                                                                  ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_static_assert_typedef_55 __attribu...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_static_assert_typedef_55 __attribu...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_static_assert_typedef_55 __attribu...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_static_assert_typedef_56 __attrib...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_static_assert_typedef_56 __attrib...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_static_assert_typedef_56 __attrib...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$

On 22 Jul 2017 3:54 am, "zosrothko via cfe-dev" <[hidden email]> wrote:
Hello CFE list

Sorry to post again this post, but I am really stacked on this problem.

I have an issue compiling a small c++ program with clang++-3.8 on Ubuntu trusty

Using the joined c++ program bug.cpp,
  • clang++-3.8 -std=c++11 bug.cpp compiles fine while
  • clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid compile errors.

What could be the problem and how can it be solved?

TIA

fandre@ubuntu-trusty-64:~/clang$ uname -a
Linux ubuntu-trusty-64 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 --version
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Below is the console log

fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$ cp bug.cpp ../shared
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev
In reply to this post by Sumner, Brian via cfe-dev



Le 23/07/2017 à 18:34, Richard Smith a écrit :
On 22 Jul 2017 12:52 pm, "zosrothko via cfe-dev" <[hidden email]> wrote:



Le 22/07/2017 à 15:07, Richard Smith a écrit :
Based on the errors, I would guess that the offsetof macro is not defined. Maybe there's something wrong with your include path?
Thanks for answering, but this code compiles fine with this command below, thus I do not understand your point on the include path? (there is no private includes in this code)

clang++-3.8 -std=c++11 bug.cpp


Include path problems can show up with -stdlib=libc++ because it changes the include path, and because libc++ makes different use of #include_next than libstdc++. Please add -v to the failing command and tell us the include path that is printed.

The verbose option on the command that is ok.
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -v  bug.cpp
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.1.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.1.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/usr/lib/llvm-3.8/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name bug.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/fandre/clang -ferror-limit 19 -fmessage-length 158 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/bug-70ad74.o -x c++ bug.cpp
clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1"
#include "..." search starts here:
#include <...> search starts here:
 /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1
 /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1
 /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/backward
 /usr/local/include
 /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../.. -L/usr/lib/llvm-3.8/bin/../lib -L/lib -L/usr/lib /tmp/bug-70ad74.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../x86_64-linux-gnu/crtn.o
fandre@ubuntu-trusty-64:~/clang$

On 22 Jul 2017 3:54 am, "zosrothko via cfe-dev" <[hidden email]> wrote:
Hello CFE list

Sorry to post again this post, but I am really stacked on this problem.

I have an issue compiling a small c++ program with clang++-3.8 on Ubuntu trusty

Using the joined c++ program bug.cpp,
  • clang++-3.8 -std=c++11 bug.cpp compiles fine while
  • clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid compile errors.

What could be the problem and how can it be solved?

TIA

fandre@ubuntu-trusty-64:~/clang$ uname -a
Linux ubuntu-trusty-64 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 --version
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Below is the console log

fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$ cp bug.cpp ../shared
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help: compiler's error using -stdlib=libc++ with clang++-3.8

Sumner, Brian via cfe-dev
In reply to this post by Sumner, Brian via cfe-dev
(adding back cfe-dev)

Looks like your version of libc++ is too old, and you're running into llvm.org/PR19723 -- upgrading libc++ should solve the problem.

On 27 July 2017 at 00:55, zosrothko <[hidden email]> wrote:

Hi Richard

Below the list of directories containing <cstddef> or <stddef.h> as well as the bugcpp.ii


Le 26/07/2017 à 23:13, Richard Smith a écrit :
On 25 July 2017 at 05:27, zosrothko <[hidden email]> wrote:

Hi Richard

Sorry to bother you again on this issue but that's quite important for the CI jobs I am running. Here the includes listed with the -v option. Does this ring some bells?

TIA

1/ clang++-3.8 -std=c++11 -v -stdlib=libc++ bug.cpp // compile errors

clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/v1
 /usr/local/include
 /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include


Which of those directories contains a <cstddef> or <stddef.h> header? In particular, is there one in /usr/local/include?
fandre@ubuntu-trusty-64:~/clang$ find /usr -type f -name "*ddef*"
/usr/include/c++/5/cstddef
/usr/include/c++/4.8/cstddef
/usr/include/c++/4.9/cstddef
/usr/include/c++/v1/cstddef
/usr/include/linux/stddef.h
/usr/lib/llvm-3.9/lib/clang/3.9.1/include/__stddef_max_align_t.h
/usr/lib/llvm-3.9/lib/clang/3.9.1/include/stddef.h
/usr/lib/llvm-3.8/lib/clang/3.8.0/include/__stddef_max_align_t.h
/usr/lib/llvm-3.8/lib/clang/3.8.0/include/stddef.h
/usr/lib/perl/5.18.2/stddef.ph
/usr/lib/perl/5.18.2/linux/stddef.ph
/usr/lib/llvm-3.6/lib/clang/3.6.0/include/__stddef_max_align_t.h
/usr/lib/llvm-3.6/lib/clang/3.6.0/include/stddef.h
/usr/lib/llvm-3.5/lib/clang/3.5.0/include/stddef.h
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h
/usr/src/linux-headers-4.4.0-31/include/linux/stddef.h
/usr/src/linux-headers-4.4.0-31/include/uapi/linux/stddef.h
/usr/src/linux-headers-4.4.0-83/include/linux/stddef.h
/usr/src/linux-headers-4.4.0-83/include/uapi/linux/stddef.h
fandre@ubuntu-trusty-64:~/clang$



Can you provide preprocessed source for the bug.cpp file:

clang++-3.8 -std=c++11 -E -frewrite-includes -stdlib=libc++ bug.cpp -o bug.ii

End of search list.
bug.cpp:56:88: error: 'Header' does not refer to a value


2/ clang++-3.8 -std=c++11 -v  bug.cpp // compile OK

clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1"
#include "..." search starts here:
#include <...> search starts here:
 /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1
 /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1
 /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/backward
 /usr/local/include
 /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.


Le 23/07/2017 à 18:34, Richard Smith a écrit :
On 22 Jul 2017 12:52 pm, "zosrothko via cfe-dev" <[hidden email]> wrote:



Le 22/07/2017 à 15:07, Richard Smith a écrit :
Based on the errors, I would guess that the offsetof macro is not defined. Maybe there's something wrong with your include path?
Thanks for answering, but this code compiles fine with this command below, thus I do not understand your point on the include path? (there is no private includes in this code)

clang++-3.8 -std=c++11 bug.cpp


Include path problems can show up with -stdlib=libc++ because it changes the include path, and because libc++ makes different use of #include_next than libstdc++. Please add -v to the failing command and tell us the include path that is printed.
On 22 Jul 2017 3:54 am, "zosrothko via cfe-dev" <[hidden email]> wrote:
Hello CFE list

Sorry to post again this post, but I am really stacked on this problem.

I have an issue compiling a small c++ program with clang++-3.8 on Ubuntu trusty

Using the joined c++ program bug.cpp,
  • clang++-3.8 -std=c++11 bug.cpp compiles fine while
  • clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp produces invalid compile errors.

What could be the problem and how can it be solved?

TIA

fandre@ubuntu-trusty-64:~/clang$ uname -a
Linux ubuntu-trusty-64 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 --version
clang version 3.8.0-2ubuntu3~trusty4 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Below is the console log

fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$ cp bug.cpp ../shared
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 bug.cpp
fandre@ubuntu-trusty-64:~/clang$ clang++-3.8 -std=c++11 -stdlib=libc++ bug.cpp
bug.cpp:56:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:56:96: error: use of undeclared identifier 'code'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                               ^
bug.cpp:56:111: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, code) == 0x01)>)> poco_...
                                                                                                              ^
bug.cpp:57:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:57:96: error: use of undeclared identifier 'checksum'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> p...
                                                                                               ^
bug.cpp:57:115: error: type name requires a specifier or qualifier
  ...poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, checksum) == 0x02)>)> poco_stati...
                                                                                                              ^
bug.cpp:58:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:58:96: error: use of undeclared identifier 'id'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                               ^
bug.cpp:58:109: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, id) == 0x04)>)> poco_st...
                                                                                                            ^
bug.cpp:59:88: error: 'Header' does not refer to a value
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                       ^
bug.cpp:45:9: note: declared here
 struct Header
        ^
bug.cpp:59:96: error: use of undeclared identifier 'seq'
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                               ^
bug.cpp:59:110: error: type name requires a specifier or qualifier
 typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (offsetof(Header, seq) == 0x06)>)> poco_s...
                                                                                                             ^
12 errors generated.
fandre@ubuntu-trusty-64:~/clang$


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev







_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...