aboutsummaryrefslogtreecommitdiff
path: root/test/Misc/diag-template-diffing.cpp
AgeCommit message (Collapse)Author
2013-04-03Do not assume the template argument is an integer only because theRichard Trieu
expressions are integer. It can also be ValueDecl expressions Use the type information from the TemplateParameterList instead Patch by Olivier Goffart! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178611 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Fix a crasher in Template Diffing.Richard Trieu
When support was added for declaration arguments, the case of variadic declaration arguments was not supported. This patch fixes that problem by not crashing when certain ValueDecl's are null. Patch by Olivier Goffart! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Fix a crasher in Template Diffing.Richard Trieu
Value depenedent expressions for default arguments cannot be evaluated. Instead, use the desugared template type to get an argument expression that can be used. This is needed for both integer and declaration arguements. Also, move this common code into a separate function. Patch by Olivier Goffart! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23Strip off local qualifiers when converting from RecordType toRichard Trieu
TemplateSpecializationType during template type diffing. This allows the correct printing of diffing qualifiers on templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15Improve template diffing handling of default integer values.Richard Trieu
When the template argument is both default and value dependent, the expression retrieved for the default argument cannot be evaluated, thus never matching any argument value. To get the proper value, get the template argument from the desugared template specialization. Also, output the original expression to provide more information about the argument mismatch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177209 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Update template diffing to handle template arguments that are declarations.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31When comparing two template template arguments in the template differ, considerRichard Trieu
them the same if they are actually the same; having the same name isn't enough. Similar to r174013, template template arguments were also mistakenly considered the same when they had the same name but were in different namespaces. In addition, when printing template template arguments, use the qualified name if the regular name is the same. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31When comparing two templates in the template differ, consider them theDouglas Gregor
same if they are actually the same; having the same name isn't enough. Fixes <rdar://problem/12931988>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174013 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30Handle passing non-Qualtypes to %diff better. Instead of asserting, fall backRichard Trieu
to printing the default case. This is a fix for PR15023. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173965 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-21Use a safe default width for template-diff'ing integral arguments, inDouglas Gregor
case we can't find an exact width to use. Fixes crash in <rdar://problem/12456626>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170951 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18Fix a crash in diagnostic printing when a template class type is diff'edEli Friedman
against itself. PR14489. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170474 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14Make template diffing handle integral expressions of various widths correctly.Eli Friedman
PR14342. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168005 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Fix the template type diffing to handle integral template arguments.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-28Update template type diffing to handle qualifiers. Differing qualifiers willRichard Trieu
now be printed with highlighting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationTypeRichard Smith
for a type alias template can appear as sugar at any level of desugaring, just like a TypedefType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29Fix typos from r159463 and update tests. Added Matt Beaumont-Gay's suggestionRichard Trieu
to improve wording of a diagnostic message. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28Only print a semicolon after "no known conversion for Nth argument" if thereMatt Beaumont-Gay
is a following clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159369 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-26Add template type diffing to Clang. This feature will provide a betterRichard Trieu
comparison between two templated types when they both appear in a diagnostic. Type elision will remove indentical template arguments, which can be disabled with -fno-elide-type. Cyan highlighting is applied to the differing types. For more formatting, -fdiagnostic-show-template-tree will output the template type as an indented text tree, with differences appearing inline. Template tree works with or without type elision. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159216 91177308-0d34-0410-b5e6-96231b3b80d8