[cfe-users] New PM custom arguments

2020-05-15 Thread Adrián Ciudad via cfe-users
Hi, I am adapting a pass plugin for opt to the new Pass Manager and
everything is fine but the arguments that this pass requires. The next
line works with the legacy PM and --xxx (or whatever) is understood:
  cl::opt OutputFilename("xxx", cl::desc("This is a
parameter"), cl::value_desc("xxx"));
But this is not the case for the new PM. What can I do?
I have read an answer to a similar question that suggests to build the
pass inside LLVM, but there should be a better way to accept
arguments. Other than that, I can't find anything about this issue.
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


Re: [cfe-users] Compiling C++ 20 Example from 24.6.4.1 [range.istream.overview] produces errors with libstdc++ 10

2020-05-15 Thread Richard Smith via cfe-users
On Thu, 14 May 2020 at 03:50, Ray Lischner  wrote:

> On 5/13/20 10:09 PM, Richard Smith wrote:
> > On Wed, 6 May 2020 at 09:24, Ray Lischner via cfe-users
> > mailto:cfe-users@lists.llvm.org>> wrote:
> >
> > I am using clang++ 10 with GCC libstdc++ 10 prerelease. I tried
> > compiling the example from section 24.6.4.1
> > [range.istream.overview]. It
> > works with g++ 10 but with clang++ 10 -std=c++20, I get
> > constraint-failure errors.
> >
> > program:
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> >
> > int main()
> > {
> > using namespace std;
> > using namespace ranges;
> > auto ints = istringstream{"0 1  2   3 4"};
> > ranges::copy(istream_view(ints),
> > ostream_iterator{cout, "-"});
> > // prints0-1-2-3-4-
> > }
> >
> > $ clang++ -std=c++20 -o range_istream_overview \
> > range_istream_overview.cpp
> >
> > Gist of the errors is that the istream_view fails the constraints
> for a
> > range because ranges::begin() fails its constraint for the
> > basic_istream_view::begin() member function:
> >
> > { __detail::__decay_copy(__t.begin()) } -> input_or_output_iterator;
> >
> > Any ideas what's wrong or how to proceed?
> >
> >
> > Please could you provide the complete set of diagnostics from the
> > compilation?
>
> In file included from range_istream_overview.cpp:1:
> In file included from
>
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/algorithm:61:
> In file included from
>
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/stl_algobase.h:65:
> In file included from
>
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:71:
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/iterator_concepts.h:884:13:
>
> error: no matching function for call to '__ranges_begin'
>  = decltype(__detail::__ranges_begin(std::declval<_Tp&>()));
> ^~~~
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/range_access.h:874:5:
>
> note: in instantiation of template type alias '__range_iter_t' requested
> here
>  using iterator_t = std::__detail::__range_iter_t<_Tp>;
>  ^
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/ranges:134:43:
>
> note: in instantiation of template type alias 'iterator_t' requested here
>data() requires contiguous_iterator>
>^
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/ranges:956:14:
>
> note: in instantiation of template class
> 'std::ranges::view_interface std::char_traits > >' requested here
>  : public view_interface>
>   ^
> range_istream_overview.cpp:12:16: note: in instantiation of template
> class 'std::ranges::basic_istream_view
>  >' requested here
>ranges::copy(istream_view(ints), ostream_iterator{cout, "-"});
> ^
>

OK, so the relevant part is this:


> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/iterator_concepts.h:867:7:
>
> note: candidate template ignored: constraints not satisfied [with _Tp =
> std::ranges::basic_istream_view >]
>__ranges_begin(_Tp& __t)
>^
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/iterator_concepts.h:865:16:
>
> note: because 'is_array_v std::char_traits > >' evaluated to false
>requires is_array_v<_Tp> || __member_begin<_Tp&> ||
> __adl_begin<_Tp&>
> ^
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/iterator_concepts.h:865:35:
>
> note: and 'std::ranges::basic_istream_view std::char_traits > &' does not satisfy '__member_begin'
>requires is_array_v<_Tp> || __member_begin<_Tp&> ||
> __adl_begin<_Tp&>
>^
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/iterator_concepts.h:849:33:
>
> note: because '__detail::__decay_copy(__t.begin())' would be invalid: no
> member named 'begin' in 'std::ranges::basic_istream_view std::char_traits >'
>{ __detail::__decay_copy(__t.begin()) } ->
> input_or_output_iterator;
> ^
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/iterator_concepts.h:865:59:
>
> note: and 'std::ranges::basic_istream_view std::char_traits > &' does not satisfy '__adl_begin'
>requires is_array_v<_Tp> || __member_begin<_Tp&> ||
> __adl_begin<_Tp&>
>^
> /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/bits/iterator_concepts.h:859:29:
>
> note: because '__detail::__decay_copy(begin(__t))' would be invalid:
> call to deleted function 'begin'
>{ __detail::__decay_copy(begin(__t)) } ->
> i