Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0 |
|
#
83ea47ac |
| 04-Sep-2022 |
Fangrui Song <i@maskray.me> |
[test] Make tests pass regardless of gnu++14/gnu++17 default
GCC from 11 onwards defaults to -std=gnu++17 for C++ source files. We want to do the same (https://discourse.llvm.org/t/c-objc-switch-to-
[test] Make tests pass regardless of gnu++14/gnu++17 default
GCC from 11 onwards defaults to -std=gnu++17 for C++ source files. We want to do the same (https://discourse.llvm.org/t/c-objc-switch-to-gnu-17-as-the-default-dialect/64360). Split RUN lines, adjust `-verify`, or add `__cplusplus < 201703L` or `-Wno-dynamic-exception-spec`, so that tests will pass regardless of gnu++14/gnu++17 default.
We have a desire to mark a test compatible with multiple language standards. There are ongoing discussions how to add markers in the long term:
* https://discourse.llvm.org/t/iterating-lit-run-lines/62596 * https://discourse.llvm.org/t/lit-run-a-run-line-multiple-times-with-different-replacements/64932
As a workaround in the short term, add lit substitutions `%std_cxx98-`, `%std_cxx11-14`, etc. They can be used for tests which work across multiple language standards. If a range has `n` standards, run lit multiple times, with `LIT_CLANG_STD_GROUP=0`, `LIT_CLANG_STD_GROUP=1`, etc to cover all `n` standards.
Reviewed By: #clang-language-wg, aaron.ballman
Differential Revision: https://reviews.llvm.org/D131464
show more ...
|
Revision tags: llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1 |
|
#
eb10b065 |
| 27-Jul-2020 |
Bruno Ricci <riccibrun@gmail.com> |
[clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.
Background: ----------- There are two related argument types which can be sent into a diagnostic to display the name
[clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.
Background: ----------- There are two related argument types which can be sent into a diagnostic to display the name of an entity: DeclarationName (ak_declarationname) or NamedDecl* (ak_nameddecl) (there is also ak_identifierinfo for IdentifierInfo*, but we are not concerned with it here).
A DeclarationName in a diagnostic will just be streamed to the output, which will directly result in a call to DeclarationName::print.
A NamedDecl* in a diagnostic will also ultimately result in a call to DeclarationName::print, but with two customisation points along the way:
The first customisation point is NamedDecl::getNameForDiagnostic which is overloaded by FunctionDecl, ClassTemplateSpecializationDecl and VarTemplateSpecializationDecl to print the template arguments, if any.
The second customisation point is NamedDecl::printName. By default it just streams the stored DeclarationName into the output but it can be customised to provide a user-friendly name for an entity. It is currently overloaded by DecompositionDecl and MSGuidDecl.
What this patch does: --------------------- For many diagnostics a DeclarationName is used instead of the NamedDecl*. This bypasses the two customisation points mentioned above. This patches fix this for diagnostics in Sema.cpp, SemaCast.cpp, SemaChecking.cpp, SemaDecl.cpp, SemaDeclAttr.cpp, SemaDecl.cpp, SemaOverload.cpp and SemaStmt.cpp.
I have only modified diagnostics where I could construct a test-case which demonstrates that the change is appropriate (either with this patch or the next one).
Reviewed By: erichkeane, aaron.ballman
Differential Revision: https://reviews.llvm.org/D84656
show more ...
|
#
be8e5fee |
| 18-Jul-2020 |
Bruno Ricci <riccibrun@gmail.com> |
[clang][NFC] Tests showing the problems with some uses of NamedDecl::getDeclName in diagnostics, SemaExpr.cpp part
|
Revision tags: llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1 |
|
#
c56975e2 |
| 07-Apr-2020 |
Richard Smith <richard@metafoo.co.uk> |
Fix template instantiation of a non-dependent call to an inherited constructor with default arguments.
We used to try to rebuild the call as a call to the faked-up inherited constructor, which is on
Fix template instantiation of a non-dependent call to an inherited constructor with default arguments.
We used to try to rebuild the call as a call to the faked-up inherited constructor, which is only a placeholder and lacks (for example) default arguments. Instead, build the call by reference to the original constructor.
In passing, add a note to say where a call that recursively uses a default argument from within itself occurs. This is usually pretty obvious, but still at least somewhat useful, and would have saved significant debugging time for this particular bug.
show more ...
|
Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1, llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1, llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1 |
|
#
b82a9401 |
| 14-Jun-2016 |
Serge Pavlov <sepavloff@gmail.com> |
Detect recursive default argument definition
If definition of default function argument uses itself, clang crashed, because corresponding function parameter is not associated with the default argume
Detect recursive default argument definition
If definition of default function argument uses itself, clang crashed, because corresponding function parameter is not associated with the default argument yet. With this fix clang emits appropriate error message.
This change fixes PR28105.
Differential Revision: http://reviews.llvm.org/D21301
llvm-svn: 272623
show more ...
|
Revision tags: llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1, llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1 |
|
#
999dd85e |
| 02-Dec-2014 |
Kaelyn Takata <rikka@google.com> |
Ensure typos in the default values of template parameters get diagnosed.
llvm-svn: 223177
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1, llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1, llvmorg-3.4.0, llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1, llvmorg-3.3.1-rc1, llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1, llvmorg-3.2.0, llvmorg-3.2.0-rc3, llvmorg-3.2.0-rc2, llvmorg-3.2.0-rc1, llvmorg-3.1.0, llvmorg-3.1.0-rc3, llvmorg-3.1.0-rc2, llvmorg-3.1.0-rc1 |
|
#
fa0a1f53 |
| 05-Apr-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Improve diagnostics for invalid use of non-static members / this:
* s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted the former by 28-2 in our diagnostics. * Fix the "use
Improve diagnostics for invalid use of non-static members / this:
* s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted the former by 28-2 in our diagnostics. * Fix the "use of member in static member function" diagnostic to correctly detect this situation inside a block or lambda. * Produce a more specific "invalid use of non-static member" diagnostic for the case where a nested class member refers to a member of a lexically-surrounding class.
llvm-svn: 154073
show more ...
|
Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4, llvmorg-3.0.0-rc3, llvmorg-3.0.0-rc2, llvmorg-3.0.0-rc1, llvmorg-2.9.0, llvmorg-2.9.0-rc3, llvmorg-2.9.0-rc2, llvmorg-2.9.0-rc1 |
|
#
efc46958 |
| 12-Oct-2010 |
Douglas Gregor <dgregor@apple.com> |
Parse default arguments within member functions in source order, from Manuel Klimek! Fixes PR7715.
llvm-svn: 116311
|
Revision tags: llvmorg-2.8.0, llvmorg-2.8.0-rc3, llvmorg-2.8.0-rc2, llvmorg-2.8.0-rc1, llvmorg-2.8.0-rc0, llvmorg-2.7.0 |
|
#
4f4946aa |
| 22-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Whenever we complain about a failed initialization of a function or method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/metho
Whenever we complain about a failed initialization of a function or method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/method being called and match up parameters to arguments. For example, we now get:
t.c:4:5: warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-pedantic] f(long_ptr); ^~~~~~~~ t.c:1:13: note: passing argument to parameter 'x' here void f(int *x); ^
llvm-svn: 102038
show more ...
|
#
85f90559 |
| 10-Mar-2010 |
John McCall <rjmccall@apple.com> |
When pretty-printing tag types, only print the tag if we're in C (and therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag).
Most of these testcase changes wer
When pretty-printing tag types, only print the tag if we're in C (and therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag).
Most of these testcase changes were done by script, so don't feel too sorry for my fingers.
llvm-svn: 98149
show more ...
|
#
dd1cb5b2 |
| 22-Feb-2010 |
Chris Lattner <sabre@nondot.org> |
Add 'previous declaration is here' note for param redefinition errors, e.g.:
t.c:1:21: error: redefinition of parameter 'x' int test(int x, int x); ^ t.c:1:14: note: previous de
Add 'previous declaration is here' note for param redefinition errors, e.g.:
t.c:1:21: error: redefinition of parameter 'x' int test(int x, int x); ^ t.c:1:14: note: previous declaration is here int test(int x, int x); ^
llvm-svn: 96769
show more ...
|
#
fd0b2f8f |
| 06-Jan-2010 |
John McCall <rjmccall@apple.com> |
Improve the diagnostics used to report implicitly-generated class members as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions.
Adjust a lot of tests.
llv
Improve the diagnostics used to report implicitly-generated class members as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions.
Adjust a lot of tests.
llvm-svn: 92832
show more ...
|
#
b6ea6087 |
| 22-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequence
llvm-svn: 91927
|
#
39c778b4 |
| 20-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Switch default-initialization of variables of class type (or array thereof) over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one
llvm-svn
Switch default-initialization of variables of class type (or array thereof) over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one
llvm-svn: 91796
show more ...
|
#
8fbe78f6 |
| 15-Dec-2009 |
Daniel Dunbar <daniel@zuster.org> |
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'. - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead o
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'. - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target).
llvm-svn: 91446
show more ...
|
Revision tags: llvmorg-2.6.0 |
|
#
c732aba9 |
| 11-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
Cleanup and test C++ default arguments. Improvements include:
- Diagnose attempts to add default arguments to templates (or member functions of templates) after the initial declaration (DR217)
Cleanup and test C++ default arguments. Improvements include:
- Diagnose attempts to add default arguments to templates (or member functions of templates) after the initial declaration (DR217). - Improve diagnostics when a default argument is redefined. Now, the note will always point at the place where the default argument was previously defined, rather than pointing to the most recent declaration of the function.
llvm-svn: 81548
show more ...
|
#
3af2a777 |
| 22-Jul-2009 |
Eli Friedman <eli.friedman@gmail.com> |
Fix the parsing of default arguments for inline member function definitions.
I'm not very familiar with this code, so please review.
llvm-svn: 76796
|
#
84613c4e |
| 12-Jun-2009 |
Anders Carlsson <andersca@mac.com> |
It's an error to use a function declared in a class definition as a default argument before the function has been declared.
llvm-svn: 73234
|
#
a45cf5b6 |
| 24-Mar-2009 |
Daniel Dunbar <daniel@zuster.org> |
Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
Revision tags: llvmorg-2.5.0 |
|
#
df0913ba |
| 08-Feb-2009 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Fix redundant errors with missing default arguments in member declarations.
llvm-svn: 64085
|
#
aa400d83 |
| 08-Feb-2009 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Make the test cases failing due to exact diagnostic matching XFAIL.
llvm-svn: 64080
|
#
58354036 |
| 24-Dec-2008 |
Douglas Gregor <dgregor@apple.com> |
Correct the order in which we cope with end-of-class-definition semantics and improve our handling of default arguments. Specifically, we follow this order:
- As soon as the see the '}' in the cla
Correct the order in which we cope with end-of-class-definition semantics and improve our handling of default arguments. Specifically, we follow this order:
- As soon as the see the '}' in the class definition, the class is complete and we add any implicit declarations (default constructor, copy constructor, etc.) to the class. - If there are any default function arguments, parse them - If there were any inline member function definitions, parse them
As part of this change, we now keep track of the the fact that we've seen unparsed default function arguments within the AST. See the new ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly cope with calls inside default function arguments to other functions where we're making use of the default arguments.
Made some C++ error messages regarding failed initializations more specific.
llvm-svn: 61406
show more ...
|
#
4d87df58 |
| 16-Dec-2008 |
Douglas Gregor <dgregor@apple.com> |
Delay parsing of default arguments of member functions until the class is completely defined (C++ [class.mem]p2).
Reverse the order in which we process the definitions of member functions specified
Delay parsing of default arguments of member functions until the class is completely defined (C++ [class.mem]p2).
Reverse the order in which we process the definitions of member functions specified inline. This way, we'll get diagnostics in the order in which the member functions were declared in the class.
llvm-svn: 61103
show more ...
|
#
29e174cc |
| 16-Dec-2008 |
Douglas Gregor <dgregor@apple.com> |
Make name lookup when we're inside a declarator's scope, such as ClassName::func, work with the new unqualified name lookup code. Test it with default arguments in out-of-line member definitions
llv
Make name lookup when we're inside a declarator's scope, such as ClassName::func, work with the new unqualified name lookup code. Test it with default arguments in out-of-line member definitions
llvm-svn: 61060
show more ...
|
#
dd12c786 |
| 16-Dec-2008 |
Douglas Gregor <dgregor@apple.com> |
Added a test for default arguments added to out-of-line member functions. They work except that name lookup within the default arguments needs to be deferred until the class definition is complete (s
Added a test for default arguments added to out-of-line member functions. They work except that name lookup within the default arguments needs to be deferred until the class definition is complete (see FIXME in the test).
llvm-svn: 61059
show more ...
|