diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-01 15:47:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-01 15:47:24 +0000 |
commit | 2e0757f3199f7bb77f59928e210ea0fb1a06256d (patch) | |
tree | 9e7a83dbf854a5ed6c11c85a4fabb1d7d3ccdc33 /clang/test/SemaTemplate/qualified-names-diag.cpp | |
parent | d28577651e6d6e494c9eb1093a23f6480b885f21 (diff) | |
download | bcm5719-llvm-2e0757f3199f7bb77f59928e210ea0fb1a06256d.tar.gz bcm5719-llvm-2e0757f3199f7bb77f59928e210ea0fb1a06256d.zip |
Give Type::getDesugaredType a "for-display" mode that can apply more
heuristics to determine when it's useful to desugar a type for display
to the user. Introduce two C++-specific heuristics:
- For a qualified type (like "foo::bar"), only produce a new
desugred type if desugaring the qualified type ("bar", in this
case) produces something interesting. For example, if "foo::bar"
refers to a class named "bar", don't desugar. However, if
"foo::bar" refers to a typedef of something else, desugar to that
something else. This gives some useful desugaring such as
"foo::bar (aka 'int')".
- Don't desugar class template specialization types like
"basic_string<char>" down to their underlying "class
basic_string<char, char_traits<char>, allocator<char>>, etc.";
it's better just to leave such types alone.
Update diagnostics.html with some discussion and examples of type
preservation in C++, showing qualified names and class template
specialization types.
llvm-svn: 68207
Diffstat (limited to 'clang/test/SemaTemplate/qualified-names-diag.cpp')
-rw-r--r-- | clang/test/SemaTemplate/qualified-names-diag.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaTemplate/qualified-names-diag.cpp b/clang/test/SemaTemplate/qualified-names-diag.cpp index bf4ae118769..4bc8bdfc9a8 100644 --- a/clang/test/SemaTemplate/qualified-names-diag.cpp +++ b/clang/test/SemaTemplate/qualified-names-diag.cpp @@ -12,5 +12,5 @@ void test() { std::vector<INT> v1; vector<Real> v2; - v1 = v2; // expected-error{{incompatible type assigning 'vector<Real>' (aka 'class std::vector<float>'), expected 'std::vector<INT>' (aka 'class std::vector<int>')}} + v1 = v2; // expected-error{{incompatible type assigning 'vector<Real>', expected 'std::vector<INT>'}} } |