This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53405] New: Enum-dependent class template instantiations not recognized


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

             Bug #: 53405
           Summary: Enum-dependent class template instantiations not
                    recognized
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ibugs@qult.net


The following code compiles with GCC 4.4.6, doesn't with GCC 4.5.4 and 4.6.0,
but does again with 4.7.0.  I'm reporting this just in case the maintainers
aren't aware of it.

  enum Tags { some_tag };

  template <bool> struct BoolValue {};

  template <Tags T>
  struct Foo {
    BoolValue<T == some_tag> meth();
  };

  template <Tags T>
  BoolValue<T == some_tag> Foo<T>::meth() {}

The compiler complains about the return type of the method's definition being

  BoolValue<(T == (Tags)0u)>

and not

  BoolValue<(T == some_tag)>

which is clearly nonsense.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]