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++/38933] [4.3/4.4 Regression] fails to build code



------- Comment #5 from rguenth at gcc dot gnu dot org  2009-01-22 12:57 -------
Hm, I don't think this is valid:

 enum Type { NAME, FACETS, TAGS, QUIET };
...
 template<typename ITEMS, typename TAGS>
 CollPrinter& operator=(const std::pair<ITEMS, TAGS>& data)
 {
...
   switch (m_type)
   {
...
    case TAGS:

is it?  EDG rejects it with

t.3.ii(73): error: type name is not allowed
                case TAGS:
                     ^

Reduced testcase:

class Foo {
  enum { TAGS = 1 };
  template <typename TAGS>
  void foo(TAGS x, int i)
  {
    switch (i) {
    case TAGS:;
    }
  }
};


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |
            Summary|[4.3/4.4 Regression] fails  |[4.3/4.4 Regression] fails
                   |to build valid code         |to build code


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


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