summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx0x-decl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [c++2a] Allow comparison functions to be explicitly defaulted.Richard Smith2019-10-221-1/+1
| | | | | | This adds some initial syntactic checking that only the appropriate function signatures can be defaulted. No implicit definitions are generated yet.
* [c++20] P1143R2: Add support for the C++20 'constinit' keyword.Richard Smith2019-09-041-4/+15
| | | | | | | | | | | | | This is mostly the same as the [[clang::require_constant_initialization]] attribute, but has a couple of additional syntactic and semantic restrictions. In passing, I added a warning for the attribute form being added after we have already seen the initialization of the variable (but before we see the definition); that case previously slipped between the cracks and the attribute was silently ignored. llvm-svn: 370972
* PR37189 Fix incorrect end source location and spelling for a split '>>' token.Richard Smith2018-04-301-3/+6
| | | | | | | | | | | | | | | | | | When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an extension) when we do the same for other tokens starting with a '>', we can't just use a location pointing to the first '>' as the location of the split token, because that would result in our miscomputing the length and spelling for the token. As a consequence, for example, a refactoring replacing 'A<X>' with something else would sometimes replace one character too many, and similarly diagnostics highlighting a template-id source range would highlight one character too many. Fix this by creating an expansion range covering the first character of the '>>' token, whose spelling is '>'. For this to work, we generalize the expansion range of a macro FileID to be either a token range (the common case) or a character range (used in this new case). llvm-svn: 331155
* Add missing direct-init / parameter-declaration-clause disambiguation whenRichard Smith2018-02-021-1/+1
| | | | | | parsing a trailing-return-type of a (function pointer) variable declaration. llvm-svn: 324151
* When a type-id is unexpectedly given a name, assume that the name is unrelatedRichard Smith2017-05-191-0/+3
| | | | | | | | syntax unless we have a reason to think otherwise. This improves error recovery in a couple of cases. llvm-svn: 303398
* Fix the location of "missing ';'" suggestions after annotation tokens.Richard Smith2017-05-181-0/+16
| | | | | | | | | | We were incorrectly setting PrevTokLocation to the first token in the annotation token instead of the last when consuming it. To fix this without adding a complex switch to the hot path through ConsumeToken, we now have a ConsumeAnnotationToken function for consuming annotation tokens in addition to the other Consume*Token special case functions. llvm-svn: 303372
* [c++1z] P0195R2: Allow multiple using-declarators in a single using-declaration.Richard Smith2016-12-161-1/+1
| | | | llvm-svn: 289905
* Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.Richard Smith2016-02-021-0/+2
| | | | llvm-svn: 259604
* Fix crash-on-invalid: don't look ahead past an unknown token, it might be EOF.Richard Smith2015-07-211-0/+4
| | | | llvm-svn: 242744
* PR20991: ::decltype is not valid.Richard Smith2014-10-041-0/+5
| | | | llvm-svn: 219043
* Revert r218925 - "Patch to warn if 'override' is missing"Alexander Potapenko2014-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | This CL has caused bootstrap failures on Linux and OSX buildbots running with -Werror. Example report from http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13183/steps/bootstrap%20clang/logs/stdio: ================================================================ [ 91%] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/ShowEnabledWarnings.cpp.o In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp:20: In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIISelLowering.h:19: /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIInstrInfo.h:71:8: error: 'getLdStBaseRegImmOfs' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/include/llvm/Target/TargetInstrInfo.h:815:16: note: overridden virtual function is here virtual bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ ================================================================ llvm-svn: 218969
* Patch to warn if 'override' is missingFariborz Jahanian2014-10-021-2/+2
| | | | | | | | | | | | for an overriding method if class has at least one 'override' specified on one of its methods. Reviewed by Doug Gregor. rdar://18295240 (I have already checked in all llvm files with missing 'override' methods and Bob Wilson has fixed a TableGen of FastISel so no warnings are expected from build of llvm after this patch. I have already verified this). llvm-svn: 218925
* PR20634: add some more cases that can legitimately come after a struct ↵Richard Smith2014-08-131-0/+5
| | | | | | declaration to our list of special cases. llvm-svn: 215520
* Allow virt-specifiers after GNU attributes in member-declarators. GCC doesn'tRichard Smith2014-01-241-1/+2
| | | | | | | | | | | allow this, and we should warn on it, but it turns out that people were already relying on this. We should introduce a -Wgcc-compat warning for this if the attributes are known to GCC, but we don't currently track enough information about attributes to do so reliably. llvm-svn: 200045
* Factor out repeated parsing of a member-declarator when parsing aRichard Smith2014-01-231-0/+6
| | | | | | | | | | member-declaration. In the process, fix a couple of bugs that had crept in where we would parse the first and subsequent member-declarators differently (in particular, we didn't accept an asm-label on a member function definition within a class, and we would accept virt-specifiers and attributes in the wrong order on the first declarator but not on subsequent ones). llvm-svn: 199957
* Downgrade bogus ExtWarn on duplicate 'friend' specifier to a Warning, and add aRichard Smith2014-01-101-0/+11
| | | | | | Warning for a duplicate 'constexpr' specifier. llvm-svn: 198956
* Support GNU attributes in alias-declarations now that GCC has implemented themRichard Smith2013-10-241-0/+9
| | | | | | and we know where they go. llvm-svn: 193297
* Don't get confused by a virt-specifier after a trailing-return-type - it's notRichard Smith2013-10-131-0/+15
| | | | | | an accidentally-included name for the declarator. llvm-svn: 192559
* PR5066: If a declarator cannot have an identifier, and cannot possibly beRichard Smith2013-07-111-0/+7
| | | | | | | | | followed by an identifier, then diagnose an identifier as being a bogus part of the declarator instead of tripping over it. Improves diagnostics for cases like std::vector<const int *p> my_vec; llvm-svn: 186061
* The 'constexpr implies const' rule for non-static member functions is gone inRichard Smith2013-04-211-1/+1
| | | | | | | | | C++1y, so stop adding the 'const' there. Provide a compatibility warning for code relying on this in C++11, with a fix-it hint. Update our lazily-written tests to add the const, except for those ones which were testing our implementation of this rule. llvm-svn: 179969
* Give this test a triple so that its use of thread_local doesn't make it fail ↵Richard Smith2013-04-131-1/+1
| | | | | | on the MSVC bot. llvm-svn: 179432
* Parsing support for thread_local and _Thread_local. We give them the sameRichard Smith2013-04-121-2/+1
| | | | | | semantics as __thread for now. llvm-svn: 179424
* Fix five more cases of tokens which can legally follow a type specifier.Richard Smith2013-01-191-0/+25
| | | | llvm-svn: 172886
* *this is const in a trailing-return-type for a constexpr member function.Richard Smith2013-01-141-0/+8
| | | | llvm-svn: 172375
* PR14855: don't silently swallow a nested-name-specifier after a type name.Richard Smith2013-01-081-0/+2
| | | | llvm-svn: 171908
* PR9903: Recover from a member functon declared with the 'typedef' specifier byRichard Smith2012-11-151-0/+5
| | | | | | | dropping the specifier, just like we do for non-member functions and function templates declared 'typedef'. Patch by Brian Brooks! llvm-svn: 168108
* DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.Richard Smith2012-10-171-6/+8
| | | | llvm-svn: 166152
* Recover properly after a parse error in a static_assert declaration.Richard Smith2012-09-131-0/+2
| | | | llvm-svn: 163826
* Splitting the duplicated decl spec extension warning into two: one is an ↵Aaron Ballman2012-08-281-1/+3
| | | | | | ExtWarn and the other a vanilla warning. This addresses PR13705, where const char const * wouldn't warn unless -pedantic was specified under the right conditions. llvm-svn: 162793
* Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11Richard Smith2012-07-241-0/+3
| | | | | | unless they appear in a decl-specifier-seq. llvm-svn: 160688
* Add diagnostics for comma at end of enum and for extra semicolon at namespaceRichard Smith2012-07-231-2/+11
| | | | | | | | scope to -Wc++11-extensions. Move extra semicolon after member function definition diagnostic out of -pedantic, since C++ allows a single semicolon there. Keep it in -Wextra-semi, though, since it's still questionable. llvm-svn: 160618
* Fix parsing of trailing-return-type. Types are syntactically prohibited fromRichard Smith2012-03-121-0/+10
| | | | | | | | being defined here: [] () -> struct S {} does not define struct S. In passing, implement DR1318 (syntactic disambiguation of 'final'). llvm-svn: 152551
* Improve the diagnostic when a comma ends up at the end of a declarator groupRichard Smith2011-10-191-0/+8
instead of a semicolon (as sometimes happens during refactorings). When such a comma is seen at the end of a line, and is followed by something which can't possibly be a declarator (or even something which might be a plausible typo for a declarator), suggest that a semicolon was intended. llvm-svn: 142544
OpenPOWER on IntegriCloud