public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55992] New: constexpr static member function not recognised in templated using statement
@ 2013-01-15 16:02 wd11 at leicester dot ac.uk
  2013-01-15 22:01 ` [Bug c++/55992] " daniel.kruegler at googlemail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: wd11 at leicester dot ac.uk @ 2013-01-15 16:02 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55992

             Bug #: 55992
           Summary: constexpr static member function not recognised in
                    templated using statement
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: wd11@leicester.ac.uk


The compiler fails to resolve a static constexpr member function which is used
in a templated using directive. For example, the following valid code
---------------------------------------------------------------------------------
#include <array>

template<unsigned MaxP, typename Type>
struct test
{
  static constexpr unsigned pole(unsigned P)
  { return P>MaxP? MaxP:P; }

  template<unsigned P>
  using my_array = std::array<Type,pole(P)>;    // causing error

  template<unsigned P>
  void do_something(my_array<P> const&, my_array<P>);
};
---------------------------------------------------------------------------------
produces (when compiling via g++ -c -std=c++11 test.cc using gcc 4.7.1 or
4.7.2)
---------------------------------------------------------------------------------
test.cc:10:42: error: ‘pole’ was not declared in this scope
---------------------------------------------------------------------------------
The compiler can be made happy by explicitly resolving ("test::pole" in line
10) or by not using my_array<> (ie. without the do_something() member)


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

end of thread, other threads:[~2014-11-18  9:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15 16:02 [Bug c++/55992] New: constexpr static member function not recognised in templated using statement wd11 at leicester dot ac.uk
2013-01-15 22:01 ` [Bug c++/55992] " daniel.kruegler at googlemail dot com
2013-01-15 22:05 ` pinskia at gcc dot gnu.org
2013-01-23 12:30 ` paolo.carlini at oracle dot com
2014-09-26 16:42 ` paolo.carlini at oracle dot com
2014-11-17 21:39 ` jason at gcc dot gnu.org
2014-11-18  9:54 ` paolo.carlini at oracle dot com

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).