[cfe-commits] [PATCH] Validate C99 and C++03's set of UCNs

Jordan Rose jordan_rose at apple.com
Fri Jan 25 16:28:18 PST 2013



================
Comment at: lib/Lex/UnicodeCharSets.h:80-85
@@ +79,8 @@
+
+///// Returns true if the Unicode code point \p C is within the set of
+///// characters specified by \p CharSet.
+//template <size_t N>
+//static inline bool isCharInSet(uint32_t C, const UnicodeCharRange (&Ranges)[N]){
+//  return isCharInSet(C, llvm::makeArrayRef(Ranges));
+//}
+
----------------
Oops. This will not appear in the final patch.

================
Comment at: lib/Lex/Lexer.cpp:2797-2803
@@ +2796,9 @@
+        DiagnosticsEngine &Diags = PP->getDiagnostics();
+        DiagnosticsEngine::Level CompatLevel =
+          Diags.getDiagnosticLevel(diag::warn_cxx11_ucn_escape_surrogate,
+                                   getSourceLocation());
+        if (CompatLevel > DiagnosticsEngine::Ignored)
+          Diag(BufferPtr, diag::warn_cxx11_ucn_escape_surrogate);
+        else
+          Diag(BufferPtr, diag::warn_ucn_escape_surrogate);
+      }
----------------
Richard Smith wrote:
> This is a bit weird. What if warn_ucn_escape_surrogate is an error but warn_cxx11_ucn_escape_surrogate is just a warning? Perhaps have just one warning, but put it in both CXX11Compat and Unicode groups?
I'm still wondering what the best thing to do here is. I was worried about "-Wunicode -Wno-c++11-compat" vs "-Wno-c++11-compat -Wunicode".


http://llvm-reviews.chandlerc.com/D327



More information about the cfe-commits mailing list