PR c++/70229
* constexpr.c (check_constexpr_ctor_body_1): Allow typedef
declarations.
* g++.dg/cpp0x/constexpr-ctor19.C: New test.
From-SVN: r239115
+2016-08-04 Marek Polacek <polacek@redhat.com>
+
+ PR c++/70229
+ * constexpr.c (check_constexpr_ctor_body_1): Allow typedef
+ declarations.
+
2016-08-01 Jason Merrill <jason@redhat.com>
* mangle.c (mangle_decl): Warn about mangled name change even if
switch (TREE_CODE (list))
{
case DECL_EXPR:
- if (TREE_CODE (DECL_EXPR_DECL (list)) == USING_DECL)
+ if (TREE_CODE (DECL_EXPR_DECL (list)) == USING_DECL
+ || TREE_CODE (DECL_EXPR_DECL (list)) == TYPE_DECL)
return true;
return false;
+2016-08-04 Marek Polacek <polacek@redhat.com>
+
+ PR c++/70229
+ * g++.dg/cpp0x/constexpr-ctor19.C: New test.
+
2016-08-04 Richard Biener <rguenther@suse.de>
PR middle-end/71984
--- /dev/null
+// PR c++/70229
+// { dg-do compile { target c++11 } }
+
+template <class>
+class S {
+ constexpr S (void) {
+ typedef int T;
+ }
+};
+
+template <class>
+class S2 {
+ constexpr S2 (void) {
+ ;
+ }
+};
+
+template <class>
+class S3 {
+ constexpr S3 (void) {
+ typedef enum { X } E;
+ } // { dg-error "does not have empty body" "" { target c++11_only } }
+};
+
+template <class>
+class S4 {
+ constexpr S4 (void) {
+ typedef struct { int j; } U;
+ } // { dg-error "does not have empty body" "" { target c++11_only } }
+};
+
+struct V
+{
+ int i;
+};
+
+template <class>
+class S5 {
+ constexpr S5 (void) {
+ typedef V W;
+ }
+};