public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61178] New: expansion pattern '#'nontype_argument_pack' not supported by dump_expr#
@ 2014-05-13 15:58 tower120 at gmail dot com
  2014-05-13 19:34 ` [Bug c++/61178] " tower120 at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tower120 at gmail dot com @ 2014-05-13 15:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61178

            Bug ID: 61178
           Summary: expansion pattern '#'nontype_argument_pack' not
                    supported by dump_expr#
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tower120 at gmail dot com

I got strange error:

expansion pattern '#'nontype_argument_pack' not supported by dump_expr#

With the following code:
http://coliru.stacked-crooked.com/a/bbacd7e9bec149f0

------------------------------------------------------------------------------
#include <iostream>
#include <utility>
#include <type_traits>
#include <typeinfo>

using namespace std;


struct Void{
    static constexpr int size = 0;
};

template<typename T0, typename T1>
class Variadic{
private:
    typedef Variadic<T0, T1> thisT;

public:
    /** Do not use this constructor */
    Variadic(T0 el0, T1 el1): value(el0), next(el1) {}

    // avoiding decltype
    typedef T0 valueT;
    T0 value;

    typedef T1 nextT;
    T1 next; // may be next pair

    /**
     * Chainable method
     */
    template<typename ValueT>
    /*constexpr*/ inline Variadic<ValueT, thisT> add(ValueT value){
        return Variadic<ValueT, thisT>(value, (*this) );
    }

};

template<typename T>
static inline Variadic<T, Void> make_variadic(T value){
    return Variadic<T, Void>(value, Void());
}




/// ERROR IS HERE!
template<typename Arg0, typename... Args>
static inline auto make_variadic(Arg0 value0, Args... values) -> decltype(
fill(make_variadic<Arg0>(value0), values...) ) {
    return fill(make_variadic<Arg0>(value0), values...);
}


///  THIS ONE BELOW, WORKS FINE
/*
template<typename Arg0, typename... Args>
static inline auto make_variadic(Arg0 value0, Args... values) ->
decltype(fill(Variadic<Arg0, Void>(value0, Void()), values...)) {
    return fill(Variadic<Arg0, Void>(value0, Void()), values...);
}*/


template<typename T, typename Arg0, typename... Args>
static inline auto fill(T self, Arg0 value, Args... values) ->
decltype(fill(self.add(value), values...)){
    return fill(self.add(value), values...);
}

template<typename T, typename Arg0>
static inline auto fill(T self, Arg0 value) -> decltype(self.add(value)){
    return self.add(value);
}



int main()
{
    auto list = make_variadic(1, 2, 3);
}


------------------------------------------------------------------------------
Command line from coliru:
g++-4.8 -std=c++11  -O2 -Wall -Wextra -pedantic -pthread -pedantic-errors
main.cpp -lm  && ./a.out


Clang compile this without errors.


If I replace make_variadic call (see code above) with function body, it works
ok.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/61178] expansion pattern '#'nontype_argument_pack' not supported by dump_expr#
  2014-05-13 15:58 [Bug c++/61178] New: expansion pattern '#'nontype_argument_pack' not supported by dump_expr# tower120 at gmail dot com
@ 2014-05-13 19:34 ` tower120 at gmail dot com
  2014-05-13 19:36 ` tower120 at gmail dot com
  2014-05-13 19:56 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tower120 at gmail dot com @ 2014-05-13 19:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61178

tower120 <tower120 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from tower120 <tower120 at gmail dot com> ---
This may be related to this
http://open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1433


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/61178] expansion pattern '#'nontype_argument_pack' not supported by dump_expr#
  2014-05-13 15:58 [Bug c++/61178] New: expansion pattern '#'nontype_argument_pack' not supported by dump_expr# tower120 at gmail dot com
  2014-05-13 19:34 ` [Bug c++/61178] " tower120 at gmail dot com
@ 2014-05-13 19:36 ` tower120 at gmail dot com
  2014-05-13 19:56 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tower120 at gmail dot com @ 2014-05-13 19:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61178

tower120 <tower120 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |---

--- Comment #2 from tower120 <tower120 at gmail dot com> ---
resolved by mistake.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/61178] expansion pattern '#'nontype_argument_pack' not supported by dump_expr#
  2014-05-13 15:58 [Bug c++/61178] New: expansion pattern '#'nontype_argument_pack' not supported by dump_expr# tower120 at gmail dot com
  2014-05-13 19:34 ` [Bug c++/61178] " tower120 at gmail dot com
  2014-05-13 19:36 ` tower120 at gmail dot com
@ 2014-05-13 19:56 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-05-13 19:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61178

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
yes, this is a dup of PR 59481 which is a dup of PR 51501

*** This bug has been marked as a duplicate of bug 51501 ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-13 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13 15:58 [Bug c++/61178] New: expansion pattern '#'nontype_argument_pack' not supported by dump_expr# tower120 at gmail dot com
2014-05-13 19:34 ` [Bug c++/61178] " tower120 at gmail dot com
2014-05-13 19:36 ` tower120 at gmail dot com
2014-05-13 19:56 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).