summaryrefslogtreecommitdiff
path: root/tests/auto/cplusplus/cxx11/data
Commit message (Collapse)AuthorAgeFilesLines
* CPlusPlus: Allow " = default" also on function implementationsChristian Kandeler2022-10-241-1/+3
| | | | | | | | | | | Note that we only make sure not to trip over valid code; we make no effort to check whether default/delete is actually allowed at this type of declaration. Fixes: QTCREATORBUG-28102 Change-Id: Ic693319b9dfaf8652cf4cae9cd907a6e258ad773 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* C++: Extend alias declaration support in built-in parserChristian Kandeler2020-11-091-0/+2
| | | | | | | | The type-id in an alias declaration can also define a new type. Change-Id: I65dc397d2526c56334676c6ab522564f6748d594 Task-number: QTCREATORBUG-24875 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Built-in lexer: Recognize also reserved user-defined literalsChristian Kandeler2020-05-281-1/+1
| | | | | | | | | | | Otherwise, we trip over uses of operators from the standard library such as std::chrono's operator"" ms(), potentially breaking basic code navigation. Amends 425811291d. Fixes: QTCREATORBUG-24067 Change-Id: I3b2863ce88ee3787414e7a1acdf25f368041cdb4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Add support for nested namespaces (C++17)Colin Duquesnoy2018-02-092-0/+7
| | | | | | Task-number: QTCREATORBUG-16774 Change-Id: I3de3ac65810213e21c9a3bafef2474d252e191f7 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Support noexcept operatorClaus Steuer2015-10-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | The code model failed to parse the noexcept operator which is often used in noexcept specifiers, e.g.: "void f() noexcept(noexcept(g()));" Consequently some c++11 headers such as unordered_map, array and unordered_set could not be parsed and no code completition was available. I have created the NoExceptOperatorExpressionAST class which is created whenever a noexcept token is found in an expression with operator precedence. The noExcept test case in the cplusplus/cxx11 test now contains a function that uses the noexcept operator. Fixed noexcept operator parsing Added the test requested by Sergey Shambir, which then revealed that i had not implemeneted the noexpect operator parsing according to the c++ specification. As stated here http://cpp0x.centaur.ath.cx/expr.unary.noexcept.html the noexcept operator is a unary-expression that contains an expression (and not a constant-expression). This should now be fixed. Change-Id: Id4a99a43b660bd83e7680274491d99a698b57094 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Add basic tests for raw string literalsNikolai Kosjar2015-09-231-0/+11
| | | | | | Change-Id: I9ca253a6a2296912eafe139ce53f4f9779097248 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Basic support for C++11 user-defined literalsAdam Strzelecki2015-02-171-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 1. Extends lexer so digit or string can be followed by underscore '_' and alphanumeric defining literal. 2. Extends parser so it accepts operator"" _abc(...) user-defined literal definition. 3. Adds Token::Flags.userDefinedLiteral bool flag field representing if token carries user-defined literal. 4. Adds C++11 auto tests case with: 12_km, 0.5_Pa, 'c'_X, "abd"_L, u"xyz"_M 5. All optional suffix scanning methods now return boolean if the suffix was found. 6. Adds C++ Lexer tests for user-defined literals with C++11 feature enabled. This change however does not make QtCreator understand user-defined literal semantics, e.g. properly resolve type when applying custom literal operator. Change-Id: I30e62f025ec9fb11c39261985ea4d772b1a80949 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Support alignas in C++11 mode.Erik Verbruggen2014-07-221-0/+6
| | | | | | Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704 Task-number: QTCREATORBUG-9279 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix "duplicate data type in declaration" for lambdasNikolai Kosjar2014-07-041-0/+6
| | | | | | | | The "_type" wasn't reset. Task-number: QTCREATORBUG-12521 Change-Id: I0d38cb38e270260065313d1235d42f2689385850 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix parsing designators vs lambdasNikolai Kosjar2014-06-241-0/+1
| | | | | | | | | | | | | The introduction of C99 designators led to parsing problems with lambdas that were passed in as a function arguments. Fixed by prefering to parse without designators first. This will be cleaner/clearer once the appropriate "LanguageFeatures" from the Project Parts will be passed in. Change-Id: Ia9cb7c4a4c9345e729cf2044e1e5411fe63e33ec Reviewed-by: Wang Hoi <wanghoi@126.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++11: Fix parsing of expressions like vector<int>{1}.Christian Kamm2014-06-161-0/+1
| | | | | | | | | The parser considers '{' an operator and thus thought "template-id {" couldn't possibly be valid. This patch adds '{' as an exception to the rule. Change-Id: I40730fcdc5cade48566b4c8b6fde390f455bbdba Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++11: Fix parsing of trailing-type-specifier.Christian Kamm2014-06-042-0/+5
| | | | | | | In particular "auto foo() -> typename Foo<T>::X;" didn't parse. Change-Id: I7665c9b387e222e4107f053a529d502813ebf617 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Support __thread and thread_localOrgad Shaneh2013-11-261-0/+1
| | | | | | | Task-number: QTCREATORBUG-7679 Change-Id: I794f52b2bcfb6c78ceef86ec53b6ed32b3d53d9f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++11: Fix bug with parsing ctor initializers.Christian Kamm2012-09-251-0/+1
| | | | | | | Task-number: QTCREATORBUG-7919 Change-Id: I12307c3fb6c20424c8b5aaf564a031924c755d25 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Fix and add test for simple decltype uses.Christian Kamm2012-09-241-0/+11
| | | | | Change-Id: I7f843fa96e33671ecb135b9db6f68d9f2cbf2fac Reviewed-by: hjk <qthjk@ovi.com>
* C++11: More (expression-list) or brace-init-list.Christian Kamm2012-09-191-0/+3
| | | | | | | | | This time in the 'new' expression. Changed it to make new C(1, abc...) and new C{1, abc} work. Change-Id: I7232798fd083b653ee04ef9ede386d6536133e16 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow for typename Foo<T>{}, Foo{} and int{}.Christian Kamm2012-09-191-0/+3
| | | | | | | As a postfix expression. Change-Id: I65cae0571080a9fb699af61c661328ef06f97890 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Make expression-list expand to initializer-list.Christian Kamm2012-09-191-0/+4
| | | | | | | | | | | | | This will fix a couple more places where brace-init-lists and pack expansions are allowed but are not currently accepted by the parser. For example: foo(abc...); now parses correctly. Change-Id: I93710cef35154fea8437329f3174e4a2d56637b8 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow brace-init-list in default argument declaration.Christian Kamm2012-09-191-0/+2
| | | | | Change-Id: Iab707d855f98982697365f9a4cd7832877e64d17 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Fix use of >> in template arguments.Christian Kamm2012-09-191-0/+10
| | | | | Change-Id: Ic99ca897e7a3b9c82cf8c5093a90bf9c88dbb0ed Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Make 'enum struct', enum-base and opaque enum decls work.Christian Kamm2012-09-191-0/+11
| | | | | | | | For declarations like: enum struct Foo : long int; Change-Id: Id813efdbc31c8d70a4b40bb0101dc33a8dd2556a Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Parse alias declarations.Christian Kamm2012-09-191-0/+4
| | | | | | | | The parser no longer fails declarations like: using Foo = std::vector<int>::iterator; Change-Id: Ib3a552ebbe0147fa138db6448a52cdba8f9b9207 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow brace-init-list in range-for statement.Christian Kamm2012-09-191-0/+5
| | | | | | | | Also drop the unused 'initializer' member from RangeBasedForStatementAST. Change-Id: I078ebbc85cafa643af4bfe62d698bf7de71360e4 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Add alignof() expression.Christian Kamm2012-09-191-0/+2
| | | | | Change-Id: Id3fb30b9a16ea724bab0d5b05e8cbddb0064e6eb Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Accept ref-qualifiers in function declarators.Christian Kamm2012-09-191-0/+21
| | | | | | | | | | Means void foo() const &; void bar() &&; and the corresponding pointer-to-member declarators now parse. Change-Id: Idbf295bd4f51cd5d9e38efcac1940b8cc2e32fce Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow uniform initialization in ctor init lists.Christian Kamm2012-09-191-0/+4
| | | | | | | | | So class C { C() : _x{12}, _y({12}) {} }; now parses correctly. Change-Id: I4281dcb0541a86b550e74630cad6ae0a59fef1b4 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Don't fail on = default and = delete initializers.Christian Kamm2012-09-191-0/+8
| | | | | | | These are converted to IdExpr(SimpleName(token)) initializers. Change-Id: I1e85c4b261ca028dc75ffe6c00e1090630c2957c Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow brace initializers in return statements.Christian Kamm2012-09-191-0/+4
| | | | | | | Like return {1, 2}; Change-Id: I7442da1866b0106bc075783653c95c16ebedb51a Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow brace initializers in assignment expressions.Christian Kamm2012-09-171-0/+6
| | | | | | | | | Like: var += {1, 2}; in a function context. Change-Id: I3936c97c4fcb6b3dcac2979e0508d422d47fddfc Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow brace initializer lists in more places.Christian Kamm2012-09-171-2/+1
| | | | | | | | | | This allows them to be used in declarator initializers that expect an expression list in parentheses. Like T v({1, 2}, 3, 4); Change-Id: I62e1ffd355ca88f7acbb8708c9b40c8310489ca3 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow for brace initializers like T v{1, 2}.Christian Kamm2012-09-172-0/+9
| | | | | | | And add a basic test. Change-Id: I3b8b87d51a9da154758d17380bba5922795f675c Reviewed-by: hjk <qthjk@ovi.com>
* C++: Also parse static_assert as top-level declarationLeandro Melo2012-06-051-0/+1
| | | | | | | Add some checks for C++11 flag as well. Change-Id: Ic5ee81d72bc88a22e71b324ef01014791b833604 Reviewed-by: hjk <qthjk@ovi.com>
* C++: Added tests for C++11 features.Erik Verbruggen2012-02-104-0/+13
| | | | | Change-Id: Ifa0bc37916d3ac3a523580bec15a6685709e7810 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix semantic of C++ 11 inline namespaces.Roberto Raggi2012-02-032-0/+5
Add the declaring `inline' namespace to the `using list' of its enclosing namespace symbol. This should be enough to ensure the correct visibility of the symbols declarated in the inlined namespace. Change-Id: Id4de74577c498fe439a49709a306ef0deb145988 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>