/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Mar 2014 18:33:38 +0000 (18:33 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Mar 2014 18:33:38 +0000 (18:33 +0000)
2014-03-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58609
* decl.c (check_initializer): Return NULL_TREE after error;
consistently use inform.

/testsuite
2014-03-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58609
* g++.dg/cpp0x/constexpr-ice12.C: New.

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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-ice12.C [new file with mode: 0644]

index 3c288c0..fd0b4d2 100644 (file)
@@ -1,5 +1,11 @@
 2014-03-07  Paolo Carlini  <paolo.carlini@oracle.com>
 
+       PR c++/58609
+       * decl.c (check_initializer): Return NULL_TREE after error;
+       consistently use inform.
+
+2014-03-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
        * decl.c (check_initializer): Remove dead code.
 
 2014-03-06  Marek Polacek  <polacek@redhat.com>
index cd2cc9c..389ed1a 100644 (file)
@@ -5809,9 +5809,11 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
               "member %qD", decl);
       if (!explained)
        {
-         error ("(an out of class initialization is required)");
+         inform (input_location,
+                 "(an out of class initialization is required)");
          explained = 1;
        }
+      return NULL_TREE;
     }
 
   return init_code;
index 642abab..f516a75 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58609
+       * g++.dg/cpp0x/constexpr-ice12.C: New.
+
 2014-03-07  Thomas Schwinge  <thomas@codesourcery.com>
 
        * c-c++-common/gomp/map-1.c: Extend.
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice12.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice12.C
new file mode 100644 (file)
index 0000000..98f53b1
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/58609
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+  static constexpr int&& i = 0;  // { dg-error "initialization" }
+};
+
+int j = A::i;