summaryrefslogtreecommitdiff
path: root/lib/AST/DeclarationName.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-02-25 17:26:26 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-02-25 17:26:26 +0000
commit8388f814fbb17a5b258f0d30b0c12e4c8d109480 (patch)
tree91ca6710fc454de45470dab9f49ffa39f6763944 /lib/AST/DeclarationName.cpp
parente44e9e0a0039fb869c17a49208a3ec0c4f4a9d90 (diff)
downloadclang-8388f814fbb17a5b258f0d30b0c12e4c8d109480.tar.gz
Pretty Printer: Fix printing of conversion operator decls and calls.
- Don't emit anything when we encounter a call to a conversion operator. "bar(a & b)" instead of "bar(a & b.operator int())" This preserves the semantics and is still idempotent if we print the AST multiple times. - Properly print declarations of conversion operators. "explicit operator bool();" instead of "bool operator _Bool();" PR18776. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclarationName.cpp')
-rw-r--r--lib/AST/DeclarationName.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp
index e5019ab8d9..f9041c043c 100644
--- a/lib/AST/DeclarationName.cpp
+++ b/lib/AST/DeclarationName.cpp
@@ -191,6 +191,7 @@ raw_ostream &operator<<(raw_ostream &OS, DeclarationName N) {
return OS << *Rec->getDecl();
LangOptions LO;
LO.CPlusPlus = true;
+ LO.Bool = true;
return OS << Type.getAsString(PrintingPolicy(LO));
}
case DeclarationName::CXXUsingDirective:
@@ -546,6 +547,7 @@ void DeclarationNameInfo::printName(raw_ostream &OS) const {
OS << "operator ";
LangOptions LO;
LO.CPlusPlus = true;
+ LO.Bool = true;
OS << TInfo->getType().getAsString(PrintingPolicy(LO));
} else
OS << Name;