summaryrefslogtreecommitdiff
path: root/test/Misc/diag-template-diffing.cpp
Commit message (Collapse)AuthorAge
* Fix an edge case in the template differ with default arguments.Benjamin Kramer2013-10-08
| | | | | | | | In the test case one type is coming from a typedef with no default arg, the other has the default arg. Taking the default arg from the typedef crashes, so always use the real template paramter declaration. PR17510. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192202 91177308-0d34-0410-b5e6-96231b3b80d8
* If a default argument is a dependent type, get the real type from the desugaredRichard Trieu2013-07-20
| | | | | | | | template. Passing around dependent types can lead to integral arguments that cannot be evaluated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186757 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-04
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash on invalid in template type diffing.Richard Trieu2013-05-07
| | | | | | | | | | This is a fix for PR15895, where Clang will crash when trying to print a template diff and the template uses an address of operator. This resulted from expecting a DeclRefExpr when the Expr could have also been UnaryOperator->DeclRefExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181365 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not assume the template argument is an integer only because theRichard Trieu2013-04-03
| | | | | | | | | | | 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
* Fix a crasher in Template Diffing.Richard Trieu2013-04-03
| | | | | | | | | | | 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
* Fix a crasher in Template Diffing.Richard Trieu2013-04-03
| | | | | | | | | | | | | 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
* Strip off local qualifiers when converting from RecordType toRichard Trieu2013-03-23
| | | | | | | | 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
* Improve template diffing handling of default integer values.Richard Trieu2013-03-15
| | | | | | | | | | | 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
* Update template diffing to handle template arguments that are declarations.Richard Trieu2013-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176153 91177308-0d34-0410-b5e6-96231b3b80d8
* When comparing two template template arguments in the template differ, considerRichard Trieu2013-01-31
| | | | | | | | | | | | 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
* When comparing two templates in the template differ, consider them theDouglas Gregor2013-01-31
| | | | | | | | 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
* Handle passing non-Qualtypes to %diff better. Instead of asserting, fall backRichard Trieu2013-01-30
| | | | | | | 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
* Use a safe default width for template-diff'ing integral arguments, inDouglas Gregor2012-12-21
| | | | | | | | 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
* Fix a crash in diagnostic printing when a template class type is diff'edEli Friedman2012-12-18
| | | | | | | | against itself. PR14489. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170474 91177308-0d34-0410-b5e6-96231b3b80d8
* Make template diffing handle integral expressions of various widths correctly.Eli Friedman2012-11-14
| | | | | | | | PR14342. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168005 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the template type diffing to handle integral template arguments.Richard Trieu2012-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167252 91177308-0d34-0410-b5e6-96231b3b80d8
* Update template type diffing to handle qualifiers. Differing qualifiers willRichard Trieu2012-09-28
| | | | | | | now be printed with highlighting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164843 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationTypeRichard Smith2012-09-26
| | | | | | | | 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
* Fix typos from r159463 and update tests. Added Matt Beaumont-Gay's suggestionRichard Trieu2012-06-29
| | | | | | | to improve wording of a diagnostic message. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159473 91177308-0d34-0410-b5e6-96231b3b80d8
* Only print a semicolon after "no known conversion for Nth argument" if thereMatt Beaumont-Gay2012-06-28
| | | | | | is a following clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159369 91177308-0d34-0410-b5e6-96231b3b80d8
* Add template type diffing to Clang. This feature will provide a betterRichard Trieu2012-06-26
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