summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [VLA] Fix the test failure on msvc by specifying the triple.Tim Shen2017-02-151-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D24333 llvm-svn: 295127
* [VLA] Handle VLA size expression in a full-expression context.Tim Shen2017-02-141-0/+15
| | | | | | | | | | | | | | | | Summary: Previously the cleanups (e.g. dtor calls) are inserted into the outer scope (e.g. function body scope), instead of it's own scope. After the fix, the cleanups are inserted right after getting the size value. This fixes pr30306. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24333 llvm-svn: 295123
* Stop asserting when a meaningless -std= flag is passed for a non-compilationRichard Smith2017-02-141-0/+2
| | | | | | input kind; go back to silently ignoring the flag. llvm-svn: 295122
* Do not implicitly instantiate the definition of a class template specializationRichard Smith2017-02-141-0/+11
| | | | | | | | | | | | | | | that has been explicitly specialized! We assume in various places that we can tell the template specialization kind of a class type by looking at the declaration produced by TagType::getDecl. That was previously not quite true: for an explicit specialization, we could have first seen a template-id denoting the specialization (with a use that does not trigger an implicit instantiation of the defintiion) and then seen the first explicit specialization declaration. TagType::getDecl would previously return an arbitrary declaration when called on a not-yet-defined class; it now consistently returns the most recent declaration in that case. llvm-svn: 295118
* Improve diagnostic reporting when using __declspec without enabling ↵Aaron Ballman2017-02-142-0/+18
| | | | | | | | __declspec as a keyword. Fixes PR31936. llvm-svn: 295114
* [Driver] Report available language standards on user errorRichard Smith2017-02-143-0/+76
| | | | | | | | | In case user did not provide valid standard name for -std option, available values (with short description) will be reported. Patch by Paweł Żukowski! llvm-svn: 295113
* MS inline asm: Filter MXCSR out of the inferred clobber listReid Kleckner2017-02-141-0/+8
| | | | | | | Since r295004, LLVM has started modelling this new register, but we don't have GCC constraint inline asm spellings for it yet. llvm-svn: 295107
* [profiling] Update test cases to deal with name variable change (NFC)Vedant Kumar2017-02-142-15/+7
| | | | | | | | | This is a re-try of r295085: fix up some test cases that assume that profile name variables are preserved by the instrprof pass. This catches one additional case in test/CoverageMapping/unused_names.c. llvm-svn: 295101
* Revert "[profiling] Update test case to deal with name variable change (NFC)"Vedant Kumar2017-02-141-0/+9
| | | | | | | This reverts commit r295085, because the corresponding llvm change was reverted. llvm-svn: 295100
* [profiling] Update test case to deal with name variable change (NFC)Vedant Kumar2017-02-141-9/+0
| | | | | | | The 'profn' name variables shouldn't show up after we run the instrprof pass, see https://reviews.llvm.org/D29921 for more details. llvm-svn: 295085
* [CodeGen][ObjC] Use the type of the captured field of the enclosingAkira Hatanaka2017-02-141-0/+13
| | | | | | | | | | | | | | | | block or lambda. This is a follow-up to r281682, which fixed a bug in computeBlockInfo where the captured VarDecl's type, rather than the captured field type of the enclosing lambda or block, was used to compute the layout of a block. This commit makes similar changes to enterBlockScope. This is necessary to correctly determine whether a block capture requires cleanup. rdar://problem/30388124 llvm-svn: 295034
* clang/test/Parser/cxx1z-class-template-argument-deduction.cpp: Tweak to ↵NAKAMURA Takumi2017-02-141-1/+1
| | | | | | | | ignore thiscall. Line 38: multiple overloads of 'f' instantiate to the same signature 'void (int) __attribute__((thiscall))' llvm-svn: 295020
* Canonicalize implicit deduction guide parameter types when forming a deductionRichard Smith2017-02-141-0/+13
| | | | | | | | | | | | guide from a constructor. The purpose of this change is to avoid triggering instantiation of the class when substituting back into the deduction guide if it uses a typedef member. We will still instantiate the class if the constructor (explicitly or implicitly, directly or indirectly) uses the current instantiation in a way that we can't canonicalize out, but that seems unavoidable. llvm-svn: 295016
* [c++1z] Add some more tests for class template argument deduction, addRichard Smith2017-02-144-1/+68
| | | | | | feature-test macro, and mark feature as done on status page. llvm-svn: 295011
* [MS ABI] Correctly mangling vbase destructorsDavid Majnemer2017-02-148-25/+25
| | | | | | | | | | | | | They are a little bit of a special case in the mangling. They are always mangled without taking into account their virtual-ness of the destructor. They are also mangled to return void, unlike the actual destructor. This fixes PR31931. Differential Revision: https://reviews.llvm.org/D29912 llvm-svn: 295010
* [c++1z] Synthesize implicit deduction guides from constructors on demand. RankRichard Smith2017-02-144-34/+60
| | | | | | | | | | | | | | | | | | | such guides below explicit ones, and ensure that references to the class's template parameters are not treated as forwarding references. We make a few tweaks to the wording in the current standard: 1) The constructor parameter list is copied faithfully to the deduction guide, without losing default arguments or a varargs ellipsis (which the standard wording loses by omission). 2) If the class template declares no constructors, we add a T() -> T<...> guide (which will only ever work if T has default arguments for all non-pack template parameters). 3) If the class template declares nothing that looks like a copy or move constructor, we add a T(T<...>) -> T<...> guide. #2 and #3 follow from the "pretend we had a class type with these constructors" philosophy for deduction guides. llvm-svn: 295007
* When the new expr's array size is an ICE, emit it as a constant expression.Nick Lewycky2017-02-131-0/+7
| | | | | | This bypasses integer sanitization checks which are redundant on the expression since it's been checked by Sema. Fixes a clang codegen assertion on "void test() { new int[0+1]{0}; }" when building with -fsanitize=signed-integer-overflow. llvm-svn: 295006
* [CodeCompletion] Code complete the '__auto_type' keywordAlex Lorenz2017-02-131-0/+5
| | | | | | rdar://29219185 llvm-svn: 295003
* [CodeCompletion] Code complete the missing C++11 keywordsAlex Lorenz2017-02-132-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | This commit adds context sensitive code completion support for the C++11 keywords that currently don't have completion results. The following keywords are supported by this patch: alignas constexpr static_assert noexcept (as a function/method qualifier) thread_local The following special identifiers are also supported: final (as a method qualifier or class qualifier) override rdar://29219185 Differential Revision: https://reviews.llvm.org/D28286 llvm-svn: 295001
* [test] Make Lit tests C++11 Compatible - Objective-C++Charles Li2017-02-135-5/+5
| | | | | | | | Set 5 Objective-C++ tests to run at gnu++98 Differential Revision: https://reviews.llvm.org/D29739 llvm-svn: 294997
* [Test] Make Lit tests C++11 compatible - printf format stringCharles Li2017-02-132-9/+58
| | | | | | | | | Different diagnostics when format string does not match actual arg type. This commit contains the first 2 of 3 tests reviewed in D29685 llvm-svn: 294979
* [CodeGen] Treat auto-generated __dso_handle symbol as HiddenVisibilityReid Kleckner2017-02-132-2/+2
| | | | | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=31932 Based on a patch by Roland McGrath Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D29843 llvm-svn: 294978
* [Test] Make Lit tests C++11 compatible - nounwind noexceptCharles Li2017-02-133-3/+11
| | | | | | | | C++11 destructors are nothrow by default. Differential Revision: https://reviews.llvm.org/D29859 llvm-svn: 294972
* [ASTUnit] Clear out diagnostic state after creating the preamble.Benjamin Kramer2017-02-131-0/+5
| | | | | | | | If the preamble had diagnostic state this would leave behind invalid state in the DiagnosticsEngine and crash later. The test case runs into an assertion in DiagnosticsEngine::setSourceManager. llvm-svn: 294963
* [coroutines] NFC: Refactor Sema::CoroutineBodyStmt construction.Gor Nishanov2017-02-131-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Sema::CheckCompletedCoroutineBody was growing unwieldy with building all of the substatements. Also, constructors for CoroutineBodyStmt had way too many parameters. Instead, CoroutineBodyStmt now defines CtorArgs structure with all of the required construction parameters. CheckCompleteCoroutineBody delegates construction of individual substatements to short functions one per each substatement. Also, added a drive-by fix of initializing CoroutinePromise to nullptr in ScopeInfo.h. And addressed the FIXME that wanted to tail allocate extra room at the end of the CoroutineBodyStmt to hold parameter move expressions. (The comment was longer that the code that implemented tail allocation). Reviewers: rsmith, EricWF Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D28835 llvm-svn: 294933
* Revert r294910 and recommit r294861 and r294862 with a target triple to ↵Aaron Ballman2017-02-122-6/+17
| | | | | | hopefully appease the bots. llvm-svn: 294911
* Revert "Attributes on K&R C functions should not cause incompatible..."Renato Golin2017-02-122-11/+0
| | | | | | | | | | | | | | | | ...function type with a redeclaration having the same attribute. Fixing this introduced a secondary problem where we were assuming that K&R functions could not be attributed types when reporting old-style function definitions that are not preceded by a prototype." Also Revert "Hopefully fixes a compile error introduced by r294861." This reverts commit r294862, r294861, as they bork the ARM builds and haven't fix it back. Also, please, short commit titles, long commit decsriptions... llvm-svn: 294910
* CodeGen: annotate ObjC ARC functions with ABI constraintsSaleem Abdulrasool2017-02-111-11/+13
| | | | | | | | | | | | | | | | Certain ARC runtime functions have an ABI contract of being forwarding. Annotate the functions with the appropriate `returned` attribute on the arguments. This hoists some of the runtime ABI contract information into the frontend rather than the backend transformations. The test adjustments are to mark the returned function parameter as such. The minor change to the IR output is due to the fact that the returned reference of the object causes it to extend the lifetime of the object by returning an autoreleased return value. The result is that the explicit objc_autorelease call is no longer formed, as autorelease elision is now possible on the return. llvm-svn: 294872
* test: ignore some warnings in test code (NFC)Saleem Abdulrasool2017-02-111-4/+4
| | | | | | | Silence some diagnostics which clang now generates. This makes it easier to see the failures in lit output. NFC. llvm-svn: 294871
* [AVR] Fix __AVR_xxx macro definitions; authored by Peter WuDylan McKay2017-02-112-2/+2
| | | | | | | | | | | | | | | | | | Summary: The -mmcu option for GCC sets macros like __AVR_ATmega328P__ (with the trailing underscores), be sure to include these underscores for Clangs -mcpu option. See "AVR Built-in Macros" in https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html Reviewers: jroelofs, dylanmckay Reviewed By: jroelofs, dylanmckay Subscribers: efriedma, cfe-commits Differential Revision: https://reviews.llvm.org/D29817 llvm-svn: 294869
* Attributes on K&R C functions should not cause incompatible function type ↵Aaron Ballman2017-02-112-0/+11
| | | | | | | | with a redeclaration having the same attribute. Fixing this introduced a secondary problem where we were assuming that K&R functions could not be attributed types when reporting old-style function definitions that are not preceded by a prototype. This patch fixes PR31020. llvm-svn: 294861
* Update XFAIL line after r294781.Benjamin Kramer2017-02-111-1/+1
| | | | llvm-svn: 294820
* Move test include file from include/ to Inputs/Richard Trieu2017-02-112-8/+8
| | | | | | | The Inputs/ directory is the recommended location for extra files for test cases. No functional change. llvm-svn: 294815
* [c++1z] Tests for class template argument deduction in dependent contexts.Richard Smith2017-02-101-0/+30
| | | | llvm-svn: 294802
* Don't let EvaluationModes dictate whether an invalid base is OKGeorge Burgess IV2017-02-102-0/+34
| | | | | | | | | | | | What we want to actually control this behavior is something more local than an EvalutationMode. Please see the linked revision for more discussion on why/etc. This fixes PR31843. Differential Revision: https://reviews.llvm.org/D29469 llvm-svn: 294800
* [c++1z] Diagnose attempts to use variables with deduced class templateRichard Smith2017-02-105-10/+18
| | | | | | specialization types from within their own initializers. llvm-svn: 294796
* [c++1z] Require an initializer for deduced class template specialization types.Richard Smith2017-02-106-11/+17
| | | | | | | | It's actually meaningful and useful to allow such variables to have no initializer, but we are strictly following the standard here until the C++ committee reaches consensus on allowing this. llvm-svn: 294785
* [c++1z] Enforce restriction that deduction guide is declared in the same ↵Richard Smith2017-02-101-10/+10
| | | | | | scope as its template. llvm-svn: 294778
* [c++1z] Disallow deduction guides with deduced types that don't ↵Richard Smith2017-02-101-5/+3
| | | | | | syntactically match the template being deduced. llvm-svn: 294773
* [libclang] [OpenCL] Expose half type.Joey Gouly2017-02-101-0/+24
| | | | | | | | | | | | | | | | Expose the half type (fp16) through libclang and the python bindings. It seems CXType_LastBuiltin was not updated in b2ea6d9 ("Enable support for __float128 in Clang", 2016-04-13), so update it now. Add an Index test for OpenCL types; in the future we will add other OpenCL types such as images to this test. Patch by Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D29718 llvm-svn: 294754
* Temporarily revert "For X86-64 linux and PPC64 linux align int128 to 16 bytes."Eric Christopher2017-02-103-4/+4
| | | | | | | | | until we can get better TargetMachine::isCompatibleDataLayout to compare - otherwise we can't code generate existing bitcode without a string equality data layout. This reverts commit r294703. llvm-svn: 294708
* For X86-64 linux and PPC64 linux align int128 to 16 bytes.Eric Christopher2017-02-103-4/+4
| | | | | | | | | | For other platforms we should find out what they need and likely make the same change, however, a smaller additional change is easier for platforms we know have it specified in the ABI. clang support for r294702 llvm-svn: 294703
* [c++1z] In class template argument deduction, all declarators must deduce ↵Richard Smith2017-02-101-0/+12
| | | | | | the same type (just like with auto deduction). llvm-svn: 294700
* [Concepts] Class template associated constraintsHubert Tong2017-02-101-0/+65
| | | | | | | | | | | | | | | | Summary: This adds associated constraints as a property of class templates. An error is produced if redeclarations are not similarly constrained. Reviewers: rsmith, faisalv, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits, nwilson Differential Revision: https://reviews.llvm.org/D25674 llvm-svn: 294697
* [c++1z] P0512R0: support for 'explicit' specifier on deduction-guides.Richard Smith2017-02-103-8/+38
| | | | llvm-svn: 294693
* Add support for armv7ve flag in clang (PR31358).George Burgess IV2017-02-093-0/+25
| | | | | | | | | | | This is a followup change to add v7ve support to clang for gcc compatibility. Please see r294661. Patch by Manoj Gupta. Differential Revision: https://reviews.llvm.org/D29773 llvm-svn: 294662
* Disallow explicit instantiation and explicit specialization for deduction ↵Richard Smith2017-02-091-0/+20
| | | | | | guides. llvm-svn: 294641
* Diagnose attempts to explicitly instantiate a template at class scope. ↵Richard Smith2017-02-095-9/+21
| | | | | | Previously Clang would simply ignore the 'template' keyword in this case. llvm-svn: 294639
* [DebugInfo] Added support to Clang FE for generating debug info for ↵Amjad Aboud2017-02-093-0/+75
| | | | | | | | | | | preprocessor macros. Added "-fdebug-macro" flag (and "-fno-debug-macro" flag) to enable (and to disable) emitting macro debug info. Added CC1 "-debug-info-macro" flag that enables emitting macro debug info. Differential Revision: https://reviews.llvm.org/D16135 llvm-svn: 294637
* [c++1z] P0091R3: Basic support for deducing class template arguments via ↵Richard Smith2017-02-095-46/+192
| | | | | | deduction-guides. llvm-svn: 294613
OpenPOWER on IntegriCloud