summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-10-08 00:17:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-10-08 00:17:59 +0000
commite87aeb378dbc9149173f77b5db56d2e8a83b5bef (patch)
tree9f7d72dfe209adc85e7a22b4ff5389ea87921701 /clang/lib
parent7c2f9e80f78fbec4e382da062b967500c915c09e (diff)
downloadbcm5719-llvm-e87aeb378dbc9149173f77b5db56d2e8a83b5bef.tar.gz
bcm5719-llvm-e87aeb378dbc9149173f77b5db56d2e8a83b5bef.zip
When pretty-printing a C++11 literal operator, don't insert whitespace between
the "" and the suffix; that breaks names such as 'operator""if'. For symmetry, also remove the space between the 'operator' and the '""'. llvm-svn: 249641
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/DeclarationName.cpp2
-rw-r--r--clang/lib/AST/StmtPrinter.cpp2
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclarationName.cpp b/clang/lib/AST/DeclarationName.cpp
index b7c28772002..b2f27275f49 100644
--- a/clang/lib/AST/DeclarationName.cpp
+++ b/clang/lib/AST/DeclarationName.cpp
@@ -182,7 +182,7 @@ raw_ostream &operator<<(raw_ostream &OS, DeclarationName N) {
}
case DeclarationName::CXXLiteralOperatorName:
- return OS << "operator \"\" " << N.getCXXLiteralIdentifier()->getName();
+ return OS << "operator\"\"" << N.getCXXLiteralIdentifier()->getName();
case DeclarationName::CXXConversionFunctionName: {
OS << "operator ";
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index d0603478e6a..bf155f5680b 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -1727,7 +1727,7 @@ void StmtPrinter::VisitUserDefinedLiteral(UserDefinedLiteral *Node) {
assert(Args);
if (Args->size() != 1) {
- OS << "operator \"\" " << Node->getUDSuffix()->getName();
+ OS << "operator\"\"" << Node->getUDSuffix()->getName();
TemplateSpecializationType::PrintTemplateArgumentList(
OS, Args->data(), Args->size(), Policy);
OS << "()";
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 87f38091305..2bf4cba7984 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -2289,7 +2289,7 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext,
// This isn't a valid literal-operator-id, but we think we know
// what the user meant. Tell them what they should have written.
SmallString<32> Str;
- Str += "\"\" ";
+ Str += "\"\"";
Str += II->getName();
Diag(DiagLoc, DiagId) << FixItHint::CreateReplacement(
SourceRange(TokLocs.front(), TokLocs.back()), Str);
OpenPOWER on IntegriCloud