summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX
Commit message (Collapse)AuthorAgeFilesLines
...
* [Lex] A source-file new-line in a raw string literal results in a new-lineDavid Majnemer2015-09-231-0/+17
| | | | | | | | | Our string literal parser copied any source-file new-line characters into the execution string-literal. This is incorrect if the source-file new-line character was a \r\n sequence because new-line characters are merely \n. llvm-svn: 248392
* [Concepts] Moving tests to match the corresponding section of the TSNathan Wilson2015-09-181-0/+41
| | | | llvm-svn: 247966
* thread_local is not implemented for targeting cygwin yet.NAKAMURA Takumi2015-09-091-0/+1
| | | | llvm-svn: 247204
* [Concepts] Add diagnostic; invalid specifier on function or variable concept ↵Nathan Wilson2015-09-091-0/+13
| | | | | | | | | | | | | | declaration Summary: Diagnose variable and function concept declarations when an invalid specifier appears Reviewers: rsmith, aaron.ballman, faisalv, fraggamuffin, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12435 llvm-svn: 247194
* PR24612: Don't bail out of checking a constexpr function before checkingRichard Smith2015-08-281-3/+11
| | | | | | | whether it can ever produce a constant expression in the case where it has a void return type and no return statements. llvm-svn: 246347
* Clarify the error message when the reason the conversion is not viable is ↵Nick Lewycky2015-08-252-2/+2
| | | | | | because the returned value does not match the function return type. llvm-svn: 245979
* Instantiate function declarations in instantiated functions.Serge Pavlov2015-08-231-5/+8
| | | | | | | | | | | | | | | | | If a function declaration is found inside a template function as in: template<class T> void f() { void g(int x = T::v) except(T::w); } it must be instantiated along with the enclosing template function, including default arguments and exception specification. Together with the patch committed in r240974 this implements DR1484. Differential Revision: http://reviews.llvm.org/D11194 llvm-svn: 245810
* [Sema] Be consistent about diagnostic wording: always use "cannot".Davide Italiano2015-08-152-4/+4
| | | | | | Discussed with Richard Smith. llvm-svn: 245162
* [Sema] main can't be declared as global variable, in C++.Davide Italiano2015-08-141-0/+66
| | | | | | | | | | | So, we now reject that. We also warn for any external-linkage global variable named main in C, because it results in undefined behavior. PR: 24309 Differential Revision: http://reviews.llvm.org/D11658 Reviewed by: rsmith llvm-svn: 245051
* [modules] In C++, stop serializing and deserializing a list of declarations inRichard Smith2015-07-212-7/+9
| | | | | | | | | the identifier table. This is redundant, since the TU-scope lookups are also serialized as part of the TU DeclContext, and wasteful in a number of ways. We still emit the decls for PCH / preamble builds, since for those we want identical results, not merely semantically equivalent ones. llvm-svn: 242855
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-1/+1
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-081-0/+1
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-071-1/+0
| | | | | | failures. llvm-svn: 241642
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-071-0/+1
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 llvm-svn: 241620
* [Sema] Warn when shifting a negative value.Davide Italiano2015-07-061-1/+1
| | | | | | | | | | | | | | | Example: % ./clang -Wshift-negative-value emit.c emit.c:3:14: warning: shifting a negative signed value is undefined [-Wshift-negative-value] int a = -1 << 3; ~~ ^ 1 warning generated. PR: 24026 Differential Revision: http://reviews.llvm.org/D10938 Reviewed by: rsmith llvm-svn: 241478
* DR1909: Diagnose all invalid cases of a class member sharing its name with ↵Richard Smith2015-07-064-22/+52
| | | | | | the class. llvm-svn: 241425
* When we see something that looks like a constructor with a return type, only ↵Richard Smith2015-07-062-7/+4
| | | | | | issue one error, not two. llvm-svn: 241424
* [Sema] Don't crash when deduction fails for decltype(auto)David Majnemer2015-07-011-0/+4
| | | | | | | | | We didn't check the return result of BuildDecltypeType, resulting in us crashing when we tried to grab the canonical version of the type. This fixes PR23995. llvm-svn: 241131
* [Parse] Allow 'constexpr' in condition declarationsMeador Inge2015-06-251-0/+29
| | | | | | | | | | | | | | | | | This patch implements the functionality specified by DR948. The changes are two fold. First, the parser was modified to allow 'constexpr's to appear in condition declarations (which was a hard error before). Second, Sema was modified to cleanup maybe odr-used declarations by way of a call to 'ActOnFinishFullExpr'. As 'constexpr's were not allowed in condition declarations before the cleanup wasn't necessary (such declarations were always odr-used). This fixes PR22491. Differential Revision: http://reviews.llvm.org/D8978 llvm-svn: 240707
* Update clang to take into account the changes to personality fnsDavid Majnemer2015-06-172-2/+2
| | | | llvm-svn: 239941
* [Sema] Don't crash on out-of-line virtual constexpr functionsDavid Majnemer2015-05-221-0/+4
| | | | | | | | | | The method wasn't an overrider but didn't have 'virtual' textually written because our CXXMethodDecl was an out-of-line definition. Make sure we use the canonical decl instead. This fixes PR23629. llvm-svn: 237999
* PR20073: promote "dereference of 'void*'" from Extension to ExtWarn.Richard Smith2015-05-191-1/+1
| | | | llvm-svn: 237652
* Fix typo from r237482. "to reference of type" --> "to reference to type"Richard Trieu2015-05-163-10/+10
| | | | llvm-svn: 237507
* When emitting a dropped qualifier error, show which qualifiers are dropped.Richard Trieu2015-05-164-13/+13
| | | | llvm-svn: 237505
* Reverse the order of types in the reference dropping qualifiers error.Richard Trieu2015-05-153-10/+10
| | | | | | | | 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
* DR295: cv-qualifiers on function types are ignored in C++.Richard Smith2015-05-141-5/+10
| | | | llvm-svn: 237383
* Update cxx_dr_status to latest issues list.Richard Smith2015-05-141-1/+1
| | | | llvm-svn: 237382
* PR23334: Perform semantic checking of lambda capture initialization in the ↵Richard Smith2015-04-272-6/+6
| | | | | | | | | | | | | | | | | | right context. Previously we'd try to perform checks on the captures from the middle of parsing the lambda's body, at the point where we detected that a variable needed to be captured. This was wrong in a number of subtle ways. In PR23334, we couldn't correctly handle the list of potential odr-uses resulting from the capture, and our attempt to recover from that resulted in a use-after-free. We now defer building the initialization expression until we leave the lambda body and return to the enclosing context, where the initialization does the right thing. This patch only covers lambda-expressions, but we should apply the same change to blocks and captured statements too. llvm-svn: 235921
* [Sema] Don't crash if array bound calculation overflowed constexpr arrayDavid Majnemer2015-04-181-0/+2
| | | | | | | | | We didn't correctly expect a QualifiedTypeLoc when faced with fixing a variable array type into a constant array type. Differential Revision: http://reviews.llvm.org/D8958 llvm-svn: 235251
* Move fixit for const init from note to diag, weaken to warning in MS mode.Nico Weber2015-04-175-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r235046 turned "extern __declspec(selectany) int a;" from a declaration into a definition to fix PR23242 (required for compatibility with mc.exe output). However, this broke parsing Windows headers: A d3d11 headers contain something like struct SomeStruct {}; extern const __declspec(selectany) SomeStruct some_struct; This is now a definition, and const objects either need an explicit default ctor or an initializer so this errors out with d3d11.h(1065,48) : error: default initialization of an object of const type 'const CD3D11_DEFAULT' without a user-provided default constructor (cl.exe just doesn't implement this rule, independent of selectany.) To work around this, weaken this error into a warning for selectany decls in microsoft mode, and recover with zero-initialization. Doing this is a bit hairy since it adds a fixit on an error emitted by InitializationSequence – this means it needs to build a correct AST, which in turn means InitializationSequence::Failed() cannot return true when this fixit is applied. As a workaround, the patch adds a fixit member to InitializationSequence, and InitializationSequence::Perform() prints the diagnostic if the fixit member is set right after its call to Diagnose. That function is usually called when InitializationSequences are used – InitListChecker::PerformEmptyInit() doesn't call it, but the InitListChecker case never performs default-initialization, so this is technically OK. This is the alternative, original fix for PR20208 that got reviewed in the thread "[patch] Improve diagnostic on default-initializing const variables (PR20208)". This change basically reverts r213725, adds the original fix for PR20208, and makes the error a warning in Microsoft mode. llvm-svn: 235166
* Improve the error message for assigning to read-only variables.Richard Trieu2015-04-111-2/+2
| | | | | | | | | | Previously, many error messages would simply be "read-only variable is not assignable" This change provides more information about why the variable is not assignable, as well as note to where the const is located. Differential Revision: http://reviews.llvm.org/D4479 llvm-svn: 234677
* Generate a diagnostic when a catch handler cannot execute due to class ↵Aaron Ballman2015-04-081-2/+2
| | | | | | hierarchy inversion with regards to other catch handlers for the same block. llvm-svn: 234375
* Unify warnings/errors from "maybe you meant" to "did you mean".Eric Christopher2015-04-021-2/+2
| | | | llvm-svn: 233981
* Mark DR777 only as fixed in clang SVN.Benjamin Kramer2015-03-271-1/+1
| | | | llvm-svn: 233391
* [Sema] Implement DR777Benjamin Kramer2015-03-271-0/+20
| | | | | | | | A parameter pack after a default argument is now valid. PR23029. llvm-svn: 233377
* [Sema] Diagnose default argument on a parameter pack.Benjamin Kramer2015-03-271-0/+3
| | | | | | | | This is ill-formed (and cannot be used anyways). PR23028. llvm-svn: 233376
* C++14: Disable sized deallocation by default due to ABI breakageReid Kleckner2015-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no widely deployed standard libraries providing sized deallocation functions, so we have to punt and ask the user if they want us to use sized deallocation. In the future, when such libraries are deployed, we can teach the driver to detect them and enable this feature. N3536 claimed that a weak thunk from sized to unsized deallocation could be emitted to avoid breaking backwards compatibility with standard libraries not providing sized deallocation. However, this approach and other variations don't work in practice. With the weak function approach, the thunk has to have default visibility in order to ensure that it is overridden by other DSOs providing sized deallocation. Weak, default visibility symbols are particularly expensive on MachO, so John McCall was considering disabling this feature by default on Darwin. It also changes behavior ELF linking behavior, causing certain otherwise unreferenced object files from an archive to be pulled into the link. Our second approach was to use an extern_weak function declaration and do an inline conditional branch at the deletion call site. This doesn't work because extern_weak only works on MachO if you have some archive providing the default value of the extern_weak symbol. Arranging to provide such an archive has the same challenges as providing the symbol in the standard library. Not to mention that extern_weak doesn't really work on COFF. Reviewers: rsmith, rjmccall Differential Revision: http://reviews.llvm.org/D8467 llvm-svn: 232788
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-272-13/+13
| | | | llvm-svn: 230795
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-1/+0
| | | | llvm-svn: 230454
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-0/+1
| | | | | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
* PR22435: Correctly implement tiebreaker for reference ordering in functionRichard Smith2015-02-201-1/+22
| | | | | | | template partial ordering rules. This rule applies per pair of types being compared, not per pair of function templates being compared. llvm-svn: 229965
* FIX PR 18432, default args, friends & late-parsed members.Nathan Sidwell2015-02-191-0/+19
| | | | | | | | | | | | Sema::MergeCXXFunctionDecl: propagate hasUnparsedDefaultArg to new decl. Parser::HandleMemberFunctionDeclDelays: check hasUnparsedDefaultArg flag. Parser::ParseLexedMethodDeclaration: handle inherited unparsed default arg case. llvm-svn: 229852
* Mark DR1940 as implementedDavid Majnemer2015-02-191-0/+9
| | | | llvm-svn: 229829
* Mark DR1947 as implementedDavid Majnemer2015-02-191-0/+8
| | | | llvm-svn: 229828
* Mark DR1948 as implementedDavid Majnemer2015-02-191-0/+6
| | | | llvm-svn: 229827
* Mark DR1994 as a duplicate of DR529David Majnemer2015-02-191-0/+2
| | | | llvm-svn: 229826
* Mark DR1968 as implementedDavid Majnemer2015-02-191-0/+8
| | | | llvm-svn: 229825
* PR22566: a conversion from a floating-point type to bool is a narrowing ↵Richard Smith2015-02-191-0/+3
| | | | | | conversion. llvm-svn: 229792
* Sema: Allow 'constexpr' variables in range loopsMeador Inge2015-02-181-1/+13
| | | | | | | | This fixes PR22492, which is in response to CWG issue #1204. Per the CWG issue 'contexpr' variables are now allowed in for range loops. llvm-svn: 229716
* Revert r229543.Meador Inge2015-02-171-1/+1
| | | | | | Reverting this while build bot failures are investigated. llvm-svn: 229550
OpenPOWER on IntegriCloud