public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14032] New: non type boolean template argument partial specialization to argument in parent never matches
@ 2004-02-05 20:54 tschwinger at neoscientists dot org
  2004-02-05 20:59 ` [Bug c++/14032] " tschwinger at neoscientists dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: tschwinger at neoscientists dot org @ 2004-02-05 20:54 UTC (permalink / raw)
  To: gcc-bugs

Compiled with gcc 3.3.1 (cygwin), 3.2.3 (gentoo-linux), mingw32 3.2 the test 
code included in this report generates an endless recursion.
It compiles without errors or warnings so the underlying problem can be quite 
hard to track for the user.

$ cat <<EOF >test.cpp
#include <iostream>

template <bool compare>
struct outer
{
  template <bool compare_with,bool second>
  struct inner           // unspecialized compare != compare_with
  {
    static inline void test()
    {
      std::cout << "invert" << std::endl;
      // call version with inverted template value
      inner<! compare_with, ! second>::test();
    }
  };
  template <bool second> // specialization compare == compare_with
  struct inner<compare,second>
  {
    static inline void test()
    {
      std::cout << "second: " << second << std::endl;
    }
  };
};
int main(int argc,char* argv[],char** envp)
{
  // expected output:
  //  invert
  //  second: true
  outer<false>::inner<true,false>::test();

  // expected output:
  //  second: false
  outer<true>::inner<true,false>::test();

  return 0;
}

EOF
$ make test && ./test

-- 
           Summary: non type boolean template argument partial
                    specialization to argument in parent never matches
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tschwinger at neoscientists dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-09-15 15:36 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-14032-7865@http.gcc.gnu.org/bugzilla/>
2005-10-22 13:57 ` [Bug c++/14032] non type boolean template argument partial specialization to argument in parent never matches lerdsuwa at gcc dot gnu dot org
2006-11-09  5:25 ` bangerth at dealii dot org
2006-11-09  5:33 ` [Bug c++/14032] Specialization of inner template using outer template argument doesn't work bangerth at dealii dot org
2006-11-14 16:31 ` pinskia at gcc dot gnu dot org
2006-11-14 17:40 ` zjasz at yahoo dot com
2006-11-14 17:46 ` rguenth at gcc dot gnu dot org
2006-11-14 17:54 ` pinskia at gcc dot gnu dot org
2006-11-14 18:37 ` bangerth at math dot tamu dot edu
2007-02-16 15:10 ` twhitehe at uwo dot ca
2007-02-16 18:40 ` bangerth at dealii dot org
2007-02-16 18:48 ` bangerth at dealii dot org
2007-08-29  1:01 ` jason at gcc dot gnu dot org
2007-09-04 12:28 ` jason at gcc dot gnu dot org
2007-09-04 12:28 ` jason at gcc dot gnu dot org
2007-09-04 15:43 ` jason at gcc dot gnu dot org
2007-09-13 16:06 ` jason at gcc dot gnu dot org
2007-09-15 15:36 ` reichelt at gcc dot gnu dot org
2004-02-05 20:54 [Bug c++/14032] New: non type boolean template argument partial specialization to argument in parent never matches tschwinger at neoscientists dot org
2004-02-05 20:59 ` [Bug c++/14032] " tschwinger at neoscientists dot org
2004-02-05 21:51 ` bangerth at dealii dot org
2004-02-05 21:54 ` bangerth at dealii dot org
2004-02-06 18:47 ` giovannibajo at libero dot it
2004-02-06 19:05 ` bangerth at dealii dot org
2004-07-30 17:30 ` lerdsuwa at gcc dot gnu dot org
2004-08-14 14:20 ` lerdsuwa at gcc dot gnu dot org
2004-11-28 10:49 ` lerdsuwa at gcc dot gnu dot org
2005-09-23 22:49 ` pinskia at gcc dot gnu dot 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).