[cfe-users] Final C++20 rules and -Wambiguous-reversed-operator

2020-03-12 Thread Romain GEISSLER via cfe-users
Hi,

It looks like the working of C++20 introduced some breaking compatibilities 
with some C++17 accepted patterns. From what I read in 
https://reviews.llvm.org/rL375306 these incompatibilities weren’t really 
intented by the initial C++20 proposal, and thus broken patterns were still 
allowed as an extension, but would warn with -Wambiguous-reversed-operator 
enabled by default. Richard Smith had some hope that the C++20 standard would 
be fixed before being final.

C++20 is not fully finalized yet, but this date is approaching. What’s the 
state of the standard now ? Have the comparison issues been fixed ? If not, 
what do you suggest to users ? Fix the code (when it’s actually possible and 
make sense), or compile with -Wno-ambiguous-reversed-operator ? I am asking 
this question in the particular case of boost date_time: 
https://github.com/boostorg/date_time/issues/132 where I am actually unsure 
this is a good idea to change the existing code.

Cheers,
Romain
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


[cfe-users] Fail to build C++ module with Bazel

2020-03-12 Thread Wynand Pieterse via cfe-users
Hi all, trust all is well!

I'm trying to build C++ modules using CLang and Bazel. I've created a
special rule to compile modules, and inside the rule I've created two
actions for the seperate steps of compiling the module to a precompiled
file, and the second action builds the LLVM bitcode from the pre-compiled
file.

This is where I'm having trouble. The precompiled file builds correctly,
but the second step, building the bitcode from the precompiled header fails
with the following error:

fatal error: malformed or corrupted AST file: 'could not find file
'/home/wpieterse/.cache/bazel/_bazel_wpieterse/097a98d4b8ea7d3c9ae2315ed87ce0f0/sandbox/linux-sandbox/1/execroot/bazel_llvm
_stuff/cpp/add.cppm' referenced by AST file
'bazel-out/k8-fastbuild/bin/cpp/add.pcm''

I presume this has something to do with Bazel creating a sandbox for each
action. This is why the file cannot be found.

Also, these are the parameters sent to CLang 9.0 when compiling:

*Compiling the precompiled header:*
./clang -std=c++2a -fmodules-ts --precompile -o add.pcm add.cppm

*Compiling the bitcode:*
./clang -std=c++2a -fmodules-ts -S -emit-llvm -c add.pcm -o add.bc

I've tried searching for a way to use relative paths, but to no avail. The
file is there, inside the Bazel execution root, but not in the sandbox.

Is there a switch on CLang that can be used to use relative paths? Am I
using the correct command line switches.
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users