summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* PR18685: Ignore class template specializations as potentialKaelyn Uhrain2014-02-091-0/+16
| | | | | | | nested-name-specifiers for typos unless the typo already has a nested-name-specifier that is a template specialization. llvm-svn: 201056
* [libclang] While visiting a C++ destructor decl, keep the type identifier ↵Argyrios Kyrtzidis2014-02-091-1/+7
| | | | | | | | | | associated with the decl, don't turn it into a type ref. rdar://15907618 llvm-svn: 201042
* Improve diagnostic for using non-class/namespace/scoped enum in a nested ↵David Blaikie2014-02-096-12/+16
| | | | | | | | | | | | | | | name specifier. Rather than simply saying "X is not a class or namespace", clarify what X is by providing the aka type in the case where X is a type, or pointing to the named declaration if there's an unambiguous one to refer to. In the ambiguous case, the ambiguities are already enumerated (though could be clarified by describing what kind of entities they are) Included a few FIXMEs in tests where some further improvements could be made. llvm-svn: 201038
* Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__David Majnemer2014-02-091-0/+26
| | | | | | | | | | TargetInfo::getSuitableAlign() was introduced in r146762 and is defined as alignof(std::max_align_t). Introduce __ALIGNOF_MAX_ALIGN_T__ which exposes getSuitableAlign() so that libc++ may take advantage of it. llvm-svn: 201037
* PR16519, PR18009: When checking a partial specialization for uses of its ownRichard Smith2014-02-091-0/+58
| | | | | | | | | | template parameters, don't look for parameters of outer templates. If a problem is found in a default template argument, point the diagnostic at the partial specialization (with a note pointing at the default argument) instead of pointing it at the default argument and leaving it unclear which partial specialization os problematic. llvm-svn: 201031
* type_info objects are not unnamed_addr: the ABI requires us toJohn McCall2014-02-0814-162/+162
| | | | | | | | | | unique them and permits the implementation of dynamic_cast (and anything else which knows it's working with a complete class type) to compare their addresses directly. rdar://16005328 llvm-svn: 201020
* Move the -fms-compatibility using decl check after real access checkingReid Kleckner2014-02-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This avoids false positives from -Wmicrosoft when name lookup would normally succeed in standard C++. This triggered on a common CRTP pattern in clang, where a derived class would have a private using decl to pull in members of a dependent base: class Verifier : InstVisitor<Verifier> { private: using InstVisitor<Verifier>::visit; ... void anything() { visit(); // warned here } }; Real access checks pass here because we're in the context of the Verifier, but the -Wmicrosoft extension was just looking for the private access specifier. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2679 llvm-svn: 201019
* PR18581: Attempt to complete the type in a VLA declaration before checkingRichard Smith2014-02-081-0/+14
| | | | | | whether it's POD. llvm-svn: 201018
* MS ABI: Use the most recent decl to check the inheritance modelReid Kleckner2014-02-081-0/+4
| | | | | | This was crashing compilation of DeclContext::buildLookupImpl<>. llvm-svn: 201013
* Remove the -fhidden-weak-vtables -cc1 option. It was dead,John McCall2014-02-084-28/+11
| | | | | | gross, and increasingly replaced through other mechanisms. llvm-svn: 201011
* [analyzer] Objective-C object literals are always non-nil.Jordan Rose2014-02-082-3/+24
| | | | | | <rdar://problem/15999214> llvm-svn: 201007
* PR16638, DR1552: the exception specification on an implicitly-declaredRichard Smith2014-02-072-9/+13
| | | | | | | | | | | 'operator delete' or 'operator delete[]' is an explicit exception specification. Therefore we should diagnose 'void operator delete(void*)' instead of 'void operator delete(void*) noexcept'. This diagnostic remains an ExtWarn, since in practice people don't always include the exception specification in such a declaration. llvm-svn: 201002
* Fix test from r200979 on WindowsBen Langmuir2014-02-071-1/+1
| | | | | | | | | Hopefully the last tweak needed to get this test working everywhere. Remove matching of the prefix of sys_header.h, which was never the point of the test anyway. This avoids dealing with path separators. llvm-svn: 200987
* Objective-C. Revert patch r193003 for furtherFariborz Jahanian2014-02-071-24/+4
| | | | | | internal discussions. // rdar://16006401 llvm-svn: 200986
* Fix test from r200979 on non-Darwin systemsBen Langmuir2014-02-071-7/+7
| | | | | | | Add a darwin triple to get the behaviour from isysroot that the test expects. llvm-svn: 200982
* [analyzer] Just silence all warnings coming out of std::basic_string.Jordan Rose2014-02-072-3/+31
| | | | | | | | | This means always walking the whole call stack for the end path node, but we'll assume that's always fairly tractable. <rdar://problem/15952973> llvm-svn: 200980
* Stat system dependencies when using -verify-pchBen Langmuir2014-02-071-5/+20
| | | | | | | | We don't stat the system headers to check for stalenes during regular PCH loading for performance reasons. When explicitly saying -verify-pch, we want to check all the dependencies - user or system. llvm-svn: 200979
* Fix AAPCS compliance for HFAs containing doubles and long doublesOliver Stannard2014-02-072-1/+17
| | | | | | | | | An HFA is defined as a struct containing floating point values of the same machine type. In the 32-bit ABI, double and long double have the same machine type, so a struct with a mixture of these types must be an HFA (assuming it meets the other criteria). llvm-svn: 200971
* Revert r194097: "With this patch -Wwrite-strings is still implemented with ↵Argyrios Kyrtzidis2014-02-072-2/+19
| | | | | | | | | | | | | the terrible hack of passing -fconst-strings to -cc1" Passing or not a language option based on diagnostic settings is a bad idea, it breaks using a PCH that was compiled with different diagnostic settings. Also add a test case to make sure we don't regress. llvm-svn: 200964
* MS ABI: Don't be so hasty to judge an inheritance modelDavid Majnemer2014-02-071-0/+3
| | | | | | | | If we are in the middle of defining the class, don't attempt to validate previously annotated declarations. We may not have seen base specifiers or virtual method declarations yet. llvm-svn: 200959
* Temporary fix for PR18473: Don't try to evaluate the initializer for aRichard Smith2014-02-061-0/+15
| | | | | | | | | | | | type-dependent variable, even if the initializer isn't value-dependent. This happens for ParenListExprs composed of non-value-dependent subexpressions, for instance. We should really give ParenListExprs (and InitListExprs) the type of the initialized entity if they're used to represent a dependent initialization (and if so, set them to be type-, value- and instantiation-dependent). llvm-svn: 200954
* Fixes PR18762, stop the StmtPrinter for ObjCPropertyRefExpr from crashing onRichard Trieu2014-02-061-0/+9
| | | | | | certain receiver types. llvm-svn: 200953
* PR18128: a lambda capture-default is not permitted for a non-local lambdaRichard Smith2014-02-061-1/+21
| | | | | | expression. llvm-svn: 200948
* Use correct ld emulation for EABI hardware float triple on NetBSD.Joerg Sonnenberger2014-02-061-0/+6
| | | | llvm-svn: 200946
* Silence build-bots from the fallout of r200921David Majnemer2014-02-061-5/+11
| | | | llvm-svn: 200940
* Move -verify-pch to use VerifyJobActionBen Langmuir2014-02-061-1/+1
| | | | | | | | | Use the verify hook rather than the compile hook to represent the -verify-pch action, and move the exising --verify-debug-info action into its own subclass of VerifyJobAction. Incidentally change the name printed by -ccc-print-phases for --verify-debug-info. llvm-svn: 200938
* Wired-up the new LLVM diagnostic system into clang diagnostic system.Quentin Colombet2014-02-061-0/+34
| | | | | | | | | The approach is similar to the existing inline-asm reporting, just more general. <rdar://problem/15886278> llvm-svn: 200931
* MS ABI: Handle indirect field decls in template argsDavid Majnemer2014-02-061-0/+5
| | | | | | | Properly support fields that come from anonymous unions and structs when used as template arguments for pointer to data member params. llvm-svn: 200921
* MS ABI: Tweak pointer-to-member mangling/inheritance model selectionDavid Majnemer2014-02-061-2/+2
| | | | | | | | | | | | Properly determine the inheritance model when dealing with nullptr: - If a nullptr template argument is being checked against pointer-to-member parameter, nail down an inheritance model. N.B. We will chose an inheritance model even if we won't ultimately choose the template to instantiate! Cooky, right? - Null pointer-to-datamembers have a virtual base table offset of -1, not zero. Previously, we chose an offset of 0. llvm-svn: 200920
* check-clang: Introduce the feature "utf8-capable-terminal".NAKAMURA Takumi2014-02-062-0/+6
| | | | | | | | | | clang/test/FixIt/fixit-unicode-with-utf8-output.c has begun complained since LLVM r200885. Although it is changes for StringRef, it brought LLVM_ON_WIN32 to Support/Locale.cpp. Before r200885, LLVM_ON_WIN32 was undefined in Locale.cpp! FIXME: We should consider i18n on win32. llvm-svn: 200909
* Allow transformation of VariableArray to ConstantArray.Serge Pavlov2014-02-061-0/+21
| | | | | | | | | | | | | | | | | In the following code: struct A { static const int sz; }; template<class T> void f() { T arr[A::sz]; } the array 'arr' is represented as a variable size array in the template. If 'A::sz' gets value below in the translation unit, the array in instantiation can turn into constant size array. This change fixes PR18633. Differential Revision: http://llvm-reviews.chandlerc.com/D2688 llvm-svn: 200899
* DR101, PR12770: If a function is declared in the same context as aRichard Smith2014-02-063-11/+24
| | | | | | | | using-declaration, and they declare the same function (either because the using-declaration is in the same namespace as the declaration it imports, or because they're both extern "C"), they do not conflict. llvm-svn: 200897
* Add a CC1 option -verify-pchBen Langmuir2014-02-052-0/+27
| | | | | | | | | This option will: - load the given pch file - verify it is not out of date by stat'ing dependencies, and - return 0 on success and non-zero on error llvm-svn: 200884
* Try to fix ppc bot failure.Manman Ren2014-02-051-4/+4
| | | | llvm-svn: 200880
* PGO: instrumentation based profiling sets function attributes.Manman Ren2014-02-052-0/+86
| | | | | | | | | | | | | | | We collect a maximal function count among all functions in the pgo data file. For functions that are hot, we set its InlineHint attribute. For functions that are cold, we set its Cold attribute. We currently treat functions with >= 30% of the maximal function count as hot and functions with <= 1% of the maximal function count are treated as cold. These two numbers are from preliminary tuning on SPEC. This commit should not affect non-PGO builds and should boost performance on instrumentation based PGO. llvm-svn: 200874
* MS ABI: Fix mangling of static methods and function referencesReid Kleckner2014-02-051-0/+17
| | | | | | | | Function references always use $1? like function pointers and never $E? like var decl references. Static methods are mangled like function pointers. llvm-svn: 200869
* Don't consider records with a NULL identifier as a name for typo correction.Kaelyn Uhrain2014-02-051-0/+8
| | | | | | | | | Because in C++, "anonymous" doesn't mean "nameless" for records. In other words, RecordDecl::isAnonymousStructOrUnion only returns true if the record lacks a name *and* is not used as the type in an object's declaration. llvm-svn: 200868
* MS ABI: Mangle member pointer template argumentsReid Kleckner2014-02-051-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Member pointers are mangled as they would be represented at runtime. They can be a single integer literal, single decl, or a tuple with some more numbers tossed in. With Clang today, most of those numbers will be zero because we reject pointers to members of virtual bases. This change required moving VTableContextBase ownership from CodeGenVTables to ASTContext, because mangling now depends on vtable layout. I also hoisted the inheritance model helpers up to be inline static methods of MSInheritanceAttr. This makes the AST code that deals with member pointers much more readable. MSVC doesn't appear to have stable manglings of null member pointers: - Null data memptrs in function templates have a mangling collision with the first field of a non-polymorphic single inheritance class. - The mangling of null data memptrs changes if you add casts. - Large null function memptrs in class templates crash MSVC. Clang uses the class template mangling for null data memptrs and the function template mangling for null function memptrs to deal with this. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2695 llvm-svn: 200857
* Objective-C driver. Do not use legacy dispatch forFariborz Jahanian2014-02-051-0/+8
| | | | | | 10.5 or less for x86_64 arch. // rdar://15852259 llvm-svn: 200854
* Fix the range for Malayam UCNs in C99.Joey Gouly2014-02-051-1/+1
| | | | llvm-svn: 200845
* Don't mark decls with mismatching exception specs invalid in MS mode (PR18683)Hans Wennborg2014-02-051-0/+14
| | | | | | | | | We accept these with a warning in MS mode, but we would previously mark them invalid, causing us not to emit code for them. Differential Revision: http://llvm-reviews.chandlerc.com/D2681 llvm-svn: 200815
* Tighten lax vector-conversion rules and enforce them consistently.John McCall2014-02-043-1/+28
| | | | | | | | | | | | | | | | | | | | When a lax conversion featured a vector and a non-vector, we were only requiring the non-vector to be a scalar type, but really it needs to be a real type (i.e. integral or real floating); it is not reasonable to allow a pointer, member pointer, or complex type here. r198474 required lax conversions to match in "data size", i.e. element size * element count, forbidding matches that happen only because a vector is rounded up to the nearest power of two in size. Unfortunately, the erroneous logic was repeated in several different places; unify them to use the new condition, so that it triggers for arbitrary conversions and not just those performed as part of binary operator checking. rdar://15931426 llvm-svn: 200810
* Further simplify r200797 and add an explanatory comment.David Blaikie2014-02-041-23/+17
| | | | llvm-svn: 200805
* Simplify testcase from r200797 some more.Adrian Prantl2014-02-041-12/+9
| | | | llvm-svn: 200798
* Debug info: fix a crasher when when emitting debug info forAdrian Prantl2014-02-041-0/+36
| | | | | | | | not-yet-completed templated types. getTypeSize() needs a complete type. rdar://problem/15931354 llvm-svn: 200797
* Fix whitespace handling in empty macro expansionsJustin Bogner2014-02-041-3/+33
| | | | | | | | | | | | | When a macro expansion does not result in any tokens, and the macro name is preceded by whitespace, the whitespace should be passed to the first token that follows the macro expansion. Similarly when a macro expansion ends with a placemarker token, and that placemarker token is preceded by whitespace. This worked already for top-level macro expansions, but is now extended to also work for nested macro expansions. Patch by Harald van Dijk! llvm-svn: 200787
* Fix whitespace handling in empty macro argumentsJustin Bogner2014-02-041-0/+7
| | | | | | | | | | | | | When a function-like macro definition ends with one of the macro's parameters, and the argument is empty, any whitespace before the parameter name in the macro definition needs to be preserved. Promoting the existing NextTokGetsSpace to a preserved bit-field and checking it at the end of the macro expansion allows it to be moved to the first token following the macro expansion result. Patch by Harald van Dijk! llvm-svn: 200786
* Fix whitespace handling in ## operatorJustin Bogner2014-02-042-3/+17
| | | | | | | | | | | | | | | | | In x ## y, where x and y are regular tokens, whitespace between x and ## is ignored, and whitespace between ## and y is also ignored. When either x or y is a function argument, whitespace was preserved, but it should not be. This patch removes the checks for whitespace before ## and before y, and in the special case where x is an empty macro argument and y is a regular token, actively removes whitespace before y. One existing test is affected by that change, but as clang's output now matches the standard's requirements and that of GCC, I've tweaked the testcase. Patch by Harald van Dijk! llvm-svn: 200785
* Add implicit declarations of allocation functions when looking them up forRichard Smith2014-02-044-8/+18
| | | | | | | | redeclaration, not just when looking them up for a use -- we need the implicit declaration to appropriately check various properties of them (notably, whether they're deleted). llvm-svn: 200729
* DebugInfo: Fix for an improvement to DIBuilder to not emit {i32 0} for ↵David Blaikie2014-02-032-2/+2
| | | | | | zero-length arrays. llvm-svn: 200722
OpenPOWER on IntegriCloud