]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/47704
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Feb 2011 09:08:48 +0000 (09:08 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Feb 2011 09:08:48 +0000 (09:08 +0000)
* cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P): Use TYPE_LANG_FLAG_5
instead of TYPE_LANG_FLAG_3.
* pt.c (lookup_template_class): Copy over
ENUM_FIXED_UNDERLYING_TYPE_P.

* g++.dg/cpp0x/enum8.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170209 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/enum8.C [new file with mode: 0644]

index 0fdac3cca74613a9943873b477eccc0da1624892..d2972eb38dac72f99f9bc82fe30d5a5baeb3a2ce 100644 (file)
@@ -1,3 +1,11 @@
+2011-02-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/47704
+       * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P): Use TYPE_LANG_FLAG_5
+       instead of TYPE_LANG_FLAG_3.
+       * pt.c (lookup_template_class): Copy over
+       ENUM_FIXED_UNDERLYING_TYPE_P.
+
 2011-02-15  Jason Merrill  <jason@redhat.com>
 
        PR c++/46807
index 934dab8c451c16c999d10652e778c043e385dfe9..238d0cfd0be3662be64b38f3c3a573d72400f23e 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for C++ parsing and type checking.
    Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
@@ -115,6 +115,7 @@ c-common.h, not after.
    3: TYPE_FOR_JAVA.
    4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR
    5: CLASS_TYPE_P (in RECORD_TYPE and UNION_TYPE)
+      ENUM_FIXED_UNDERLYING_TYPE_P (in ENUMERAL_TYPE)
    6: TYPE_DEPENDENT_P_VALID
 
    Usage of DECL_LANG_FLAG_?:
@@ -3098,7 +3099,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
 
 /* Determines whether an ENUMERAL_TYPE has an explicit
    underlying type.  */
-#define ENUM_FIXED_UNDERLYING_TYPE_P(NODE) (TYPE_LANG_FLAG_3 (NODE))
+#define ENUM_FIXED_UNDERLYING_TYPE_P(NODE) (TYPE_LANG_FLAG_5 (NODE))
 
 /* Returns the underlying type of the given enumeration type. The
    underlying type is determined in different ways, depending on the
index d59f32a7ea787e19cae8c8302957bace259dbae6..fe3e954cb56f791d8af7d1a1f89d28e2def144fa 100644 (file)
@@ -6993,6 +6993,8 @@ lookup_template_class (tree d1,
               SET_SCOPED_ENUM_P (t, SCOPED_ENUM_P (template_type));
             }
           SET_OPAQUE_ENUM_P (t, OPAQUE_ENUM_P (template_type));
+         ENUM_FIXED_UNDERLYING_TYPE_P (t)
+           = ENUM_FIXED_UNDERLYING_TYPE_P (template_type);
        }
       else
        {
index 2608ce53f994df03dedfa12631ef469b465ab5ee..619292cef048106e530a5380fb2b8b18720ef054 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/47704
+       * g++.dg/cpp0x/enum8.C: New test.
+
 2011-02-15  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/inherit/implicit-trivial1.C: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum8.C b/gcc/testsuite/g++.dg/cpp0x/enum8.C
new file mode 100644 (file)
index 0000000..0075e2d
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/47704
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+void
+foo ()
+{
+  enum class E { A, B };
+  new E;
+}