Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.

llvm-svn: 152392
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 669b5b8..c4627f1 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -700,7 +700,7 @@
     // constant: integer-constant
     // constant: floating-constant
 
-    Res = Actions.ActOnNumericConstant(Tok);
+    Res = Actions.ActOnNumericConstant(Tok, /*UDLScope*/getCurScope());
     ConsumeToken();
     break;
 
@@ -841,7 +841,7 @@
   case tok::wide_char_constant:
   case tok::utf16_char_constant:
   case tok::utf32_char_constant:
-    Res = Actions.ActOnCharacterConstant(Tok);
+    Res = Actions.ActOnCharacterConstant(Tok, /*UDLScope*/getCurScope());
     ConsumeToken();
     break;
   case tok::kw___func__:       // primary-expression: __func__ [C99 6.4.2.2]
@@ -2120,18 +2120,13 @@
   SmallVector<Token, 4> StringToks;
 
   do {
-    if (!AllowUserDefinedLiteral && Tok.hasUDSuffix()) {
-      Diag(Tok, diag::err_invalid_string_udl);
-      do ConsumeStringToken(); while (isTokenStringLiteral());
-      return ExprError();
-    }
-
     StringToks.push_back(Tok);
     ConsumeStringToken();
   } while (isTokenStringLiteral());
 
   // Pass the set of string tokens, ready for concatenation, to the actions.
-  return Actions.ActOnStringLiteral(&StringToks[0], StringToks.size());
+  return Actions.ActOnStringLiteral(&StringToks[0], StringToks.size(),
+                                   AllowUserDefinedLiteral ? getCurScope() : 0);
 }
 
 /// ParseGenericSelectionExpression - Parse a C11 generic-selection