Mark DR1948 as implemented
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 19 Feb 2015 07:28:55 +0000 (07:28 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 19 Feb 2015 07:28:55 +0000 (07:28 +0000)
llvm-svn: 229827

clang/lib/Sema/SemaExceptionSpec.cpp
clang/test/CXX/drs/dr19xx.cpp
clang/www/cxx_dr_status.html

index 2387325..41abd49 100644 (file)
@@ -437,7 +437,7 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID,
       OldNR != FunctionProtoType::NR_NoNoexcept &&
       NewNR != FunctionProtoType::NR_NoNoexcept) {
     Diag(NewLoc, DiagID);
-    if (NoteID.getDiagID() != 0)
+    if (NoteID.getDiagID() != 0 && OldLoc.isValid())
       Diag(OldLoc, NoteID);
     return true;
   }
@@ -518,7 +518,7 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID,
     }
 
     Diag(NewLoc, DiagID);
-    if (NoteID.getDiagID() != 0)
+    if (NoteID.getDiagID() != 0 && OldLoc.isValid())
       Diag(OldLoc, NoteID);
     return true;
   }
@@ -547,7 +547,7 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID,
     return false;
   }
   Diag(NewLoc, DiagID);
-  if (NoteID.getDiagID() != 0)
+  if (NoteID.getDiagID() != 0 && OldLoc.isValid())
     Diag(OldLoc, NoteID);
   return true;
 }
index 8087631..dd98aaf 100644 (file)
@@ -40,6 +40,12 @@ namespace dr1902 { // dr1902: 3.7
 }
 
 #if __cplusplus >= 201103L
+// dr1948: yes
+// FIXME: This diagnostic could be improved.
+void *operator new(__SIZE_TYPE__) noexcept { return nullptr; } // expected-error{{exception specification in declaration does not match previous declaration}}
+#endif
+
+#if __cplusplus >= 201103L
 namespace dr1968 { // dr1968: yes
 static_assert(&typeid(int) == &typeid(int), ""); // expected-error{{not an integral constant expression}}
 }
index 5651a1c..fb93687 100644 (file)
@@ -11503,7 +11503,7 @@ and <I>POD class</I></td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1948">1948</a></td>
     <td>NAD</td>
     <td><I>exception-specification</I> of replacement global <TT>new</TT></td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr class="open" id="1949">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1949">1949</a></td>