diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-09-02 19:20:06 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-09-02 19:20:06 +0000 |
commit | b4a43268242c7fbea885fa5e19667181ec2c1e74 (patch) | |
tree | 68241592ab6421524736d4817b46c69f0d00cbb4 /clang/lib/AST | |
parent | 01cb19f93cc816fa01e870268dfab5a3b023e577 (diff) | |
download | bcm5719-llvm-b4a43268242c7fbea885fa5e19667181ec2c1e74.tar.gz bcm5719-llvm-b4a43268242c7fbea885fa5e19667181ec2c1e74.zip |
Mark that qualifiers can prefix the auto type. This seems to just have
been an oversight, as it definitely works. Every test which changed had
the const written on the LHS of the auto already.
Notably, this also makes things like cpp11-migrate's formation of 'const
auto &' variables much more familiar.
Yes, many people feel that 'const' and other qualifiers belong on the
RHS of the type. I'm not going to argue about that because Clang already
*overwhelming* places the qualifiers on the LHS when it can and on the
RHS when it must. We shouldn't diverge for auto. We should add a tool to
clang-tidy that fixes this in either direction, and then wire up
clang-tidy to tools like cpp11-migrate to fix their placement after
transforms.
llvm-svn: 189769
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/TypePrinter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index 344d12c44f9..ec7559c2f51 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -167,6 +167,7 @@ bool TypePrinter::canPrefixQualifiers(const Type *T, TC = Subst->getReplacementType()->getTypeClass(); switch (TC) { + case Type::Auto: case Type::Builtin: case Type::Complex: case Type::UnresolvedUsing: @@ -217,7 +218,6 @@ bool TypePrinter::canPrefixQualifiers(const Type *T, case Type::Attributed: case Type::PackExpansion: case Type::SubstTemplateTypeParm: - case Type::Auto: CanPrefixQualifiers = false; break; } |