public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64924] New: Callback function passed as a parameter with typename declaration produces an ICE.
@ 2015-02-03 18:08 martin.boretto at tallertechnologies dot com
  2015-02-03 18:17 ` [Bug c++/64924] " trippels at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: martin.boretto at tallertechnologies dot com @ 2015-02-03 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64924
           Summary: Callback function passed as a parameter with typename
                    declaration produces an ICE.
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: martin.boretto at tallertechnologies dot com

Created attachment 34659
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34659&action=edit
Preprocessed source stored

The code below produces an ICE error:


// --------------------------------------------------
template<typename T>
class PP
{
public:
    /**
    * @brief Constructor with instance and callback function.
    */
    PP(T* instance, typename PP::CallbackFunction callbackFunction);

private:
    /**
    * @brief callback function.
    */
    typedef void (T::*CallbackFunction)(void);
};

template<typename T>
PP<T>::PP(T* instance, CallbackFunction callbackFunction)
{}


// --------------------------------------------------
class JJ
{
public:
    /**
    * Constructor class.
    */
    JJ():
        _attr(this, &JJ::m)
    {}

    /**
    * @brief Call back function.
    */
    void m()
    {}

private:
    /** @brief Class attribute instantiated with "this" class. */
    PP<JJ> _attr;
};

// --------------------------------------------------

int main(int argc, char const *argv[])
{
    JJ juancillo;
    return 0;
}


Execution:

g++ -std=c++11 -Wall -Wextra -ansi -pedantic-errors example.cpp -o example


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

end of thread, other threads:[~2021-08-08  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 18:08 [Bug c++/64924] New: Callback function passed as a parameter with typename declaration produces an ICE martin.boretto at tallertechnologies dot com
2015-02-03 18:17 ` [Bug c++/64924] " trippels at gcc dot gnu.org
2020-03-12 18:52 ` mpolacek at gcc dot gnu.org
2021-08-08  8:48 ` pinskia 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).