summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/diag-template-diffing.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo from r237482. "to reference of type" --> "to reference to type"Richard Trieu2015-05-161-1/+1
| | | | llvm-svn: 237507
* When emitting a dropped qualifier error, show which qualifiers are dropped.Richard Trieu2015-05-161-1/+1
| | | | llvm-svn: 237505
* Reverse the order of types in the reference dropping qualifiers error.Richard Trieu2015-05-151-1/+1
| | | | | | | | The error has the form ... 'int' ... 'const int' ... dropped qualifiers. At first glance, it appears that the const qualifier is added. Reverse the types so that the second type is less qualified than the first. llvm-svn: 237482
* Update assumption in template diffing about integer template arguments.Richard Trieu2015-02-261-0/+13
| | | | | | | | | | Fix for PR22017. Integer template arguments are automatically bit extended to the size of the integer type. In template diffing, evaluated expressions were not having their results extending, leading to comparing two APSInt's with different widths. Apply the proper bit extending when evaluating template arguments. This mainly affected bool template arguments. llvm-svn: 230603
* When checking the template argument list, use a copy of that list for changesRichard Trieu2015-01-241-0/+14
| | | | | | | | | | | | | | | | | | | and only update the orginal list on a valid arugment list. When checking an individual expression template argument, and conversions are required, update the expression in the template argument. Since template arguments are speculatively checked, the copying of the template argument list prevents updating the template arguments when the list does not match the template. Additionally, clean up the integer checking code in the template diffing code. The code performs unneccessary conversions from APSInt to APInt. Fixes PR21758. This essentially reverts r224770 to recommits r224667 and r224668 with extra changes to prevent the template instantiation problems seen in PR22006. A test to catch the discovered problem is also added. llvm-svn: 226983
* This reverts commit r224668 and r224667.Rafael Espindola2014-12-231-14/+0
| | | | | | | | | | r224667 broke bootstrap on Fedora 20 X86_64 (at least). See pr22006 for the details. r224668 depends on r224667. llvm-svn: 224770
* Fix for PR21758Richard Trieu2014-12-201-0/+14
| | | | | | | | | When a non-type template argument expression needs a conversion to change it into the argument type, preserve that information by remaking the TemplateArgument with an expression that has those conversions. Also a small fix to template type diffing to handle the extra conversions in some cases. llvm-svn: 224667
* If a template argument is non-evaluable expression, use the profile ID to seeRichard Trieu2014-07-261-0/+35
| | | | | | if the two arguments are equal. llvm-svn: 214008
* Pass the PrintingPolicy when converting types to strings in template typeRichard Trieu2014-07-251-6/+14
| | | | | | | diffing. This removes extra "struct"/"class" in the type names and gives "bool" instead of "_Bool" for booleans. llvm-svn: 213912
* Print "(default)" for default template template arguments to match theRichard Trieu2014-07-241-1/+22
| | | | | | printing of other types. llvm-svn: 213902
* Add support for nullptr template arguments to template type diffing.Richard Trieu2014-07-241-0/+54
| | | | llvm-svn: 213840
* Fix '&' printing for template arguments in parentheses in template diffing.Richard Trieu2014-07-221-2/+6
| | | | llvm-svn: 213613
* More gracefully handle parentheses in templare arguments in template diffing.Richard Trieu2014-07-221-1/+5
| | | | llvm-svn: 213611
* Fix a template diffing problem were an '&' is unexpectedly printed inRichard Trieu2014-07-221-0/+16
| | | | | | a template argument. llvm-svn: 213609
* PR15677 - Crash in template diffing. Check that expression is evaluatable ↵Nikola Smiljanic2014-07-011-0/+37
| | | | | | before evaluating it. llvm-svn: 212090
* Fix an edge case in the template differ with default arguments.Benjamin Kramer2013-10-081-1/+17
| | | | | | | | 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. llvm-svn: 192202
* If a default argument is a dependent type, get the real type from the desugaredRichard Trieu2013-07-201-2/+24
| | | | | | | template. Passing around dependent types can lead to integral arguments that cannot be evaluated. llvm-svn: 186757
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-041-4/+4
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Fix crash on invalid in template type diffing.Richard Trieu2013-05-071-0/+27
| | | | | | | | | 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. llvm-svn: 181365
* Do not assume the template argument is an integer only because theRichard Trieu2013-04-031-0/+5
| | | | | | | | | | expressions are integer. It can also be ValueDecl expressions Use the type information from the TemplateParameterList instead Patch by Olivier Goffart! llvm-svn: 178611
* Fix a crasher in Template Diffing.Richard Trieu2013-04-031-0/+39
| | | | | | | | | | 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! llvm-svn: 178610
* Fix a crasher in Template Diffing.Richard Trieu2013-04-031-0/+55
| | | | | | | | | | | | 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! llvm-svn: 178609
* Strip off local qualifiers when converting from RecordType toRichard Trieu2013-03-231-24/+24
| | | | | | | TemplateSpecializationType during template type diffing. This allows the correct printing of diffing qualifiers on templates. llvm-svn: 177809
* Improve template diffing handling of default integer values.Richard Trieu2013-03-151-1/+1
| | | | | | | | | | 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. llvm-svn: 177209
* Update template diffing to handle template arguments that are declarations.Richard Trieu2013-02-271-0/+34
| | | | llvm-svn: 176153
* When comparing two template template arguments in the template differ, considerRichard Trieu2013-01-311-0/+8
| | | | | | | | | | | 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. llvm-svn: 174029
* When comparing two templates in the template differ, consider them theDouglas Gregor2013-01-311-0/+17
| | | | | | | same if they are actually the same; having the same name isn't enough. Fixes <rdar://problem/12931988>. llvm-svn: 174013
* Handle passing non-Qualtypes to %diff better. Instead of asserting, fall backRichard Trieu2013-01-301-0/+15
| | | | | | to printing the default case. This is a fix for PR15023. llvm-svn: 173965
* Use a safe default width for template-diff'ing integral arguments, inDouglas Gregor2012-12-211-0/+18
| | | | | | | case we can't find an exact width to use. Fixes crash in <rdar://problem/12456626>. llvm-svn: 170951
* Fix a crash in diagnostic printing when a template class type is diff'edEli Friedman2012-12-181-0/+12
| | | | | | against itself. PR14489. llvm-svn: 170474
* Make template diffing handle integral expressions of various widths correctly.Eli Friedman2012-11-141-0/+7
| | | | | | PR14342. llvm-svn: 168005
* Fix the template type diffing to handle integral template arguments.Richard Trieu2012-11-011-0/+163
| | | | llvm-svn: 167252
* Update template type diffing to handle qualifiers. Differing qualifiers willRichard Trieu2012-09-281-0/+185
| | | | | | now be printed with highlighting. llvm-svn: 164843
* Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationTypeRichard Smith2012-09-261-0/+18
| | | | | | | for a type alias template can appear as sugar at any level of desugaring, just like a TypedefType. llvm-svn: 164655
* Fix typos from r159463 and update tests. Added Matt Beaumont-Gay's suggestionRichard Trieu2012-06-291-38/+38
| | | | | | to improve wording of a diagnostic message. llvm-svn: 159473
* Only print a semicolon after "no known conversion for Nth argument" if thereMatt Beaumont-Gay2012-06-281-52/+52
| | | | | | is a following clause. llvm-svn: 159369
* Add template type diffing to Clang. This feature will provide a betterRichard Trieu2012-06-261-0/+433
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. llvm-svn: 159216
OpenPOWER on IntegriCloud