summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-static-var.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't warn about runtime behavior problems in variable initializers that weRichard Smith2017-09-231-1/+1
| | | | | | | | know are going to be constant-evaluated. Any relevant diagnostics should be produced by constant expression evaluation. llvm-svn: 314067
* Give external linkage and mangling to lambdas inside inline variables and ↵Richard Smith2017-09-221-1/+1
| | | | | | | | | | | variable templates. This implements the proposed approach in https://github.com/itanium-cxx-abi/cxx-abi/issues/33 This reinstates r313827, reverted in r313856, with a fix for the 'out-of-bounds enumeration value' ubsan error in that change. llvm-svn: 313955
* Revert "Give external linkage and mangling to lambdas inside inline ↵Vitaly Buka2017-09-211-1/+1
| | | | | | | | | | variables and variable templates." To fix: runtime error: load of value 15, which is not a valid value for type 'clang::LVComputationKind' This reverts commit r313827. llvm-svn: 313856
* Give external linkage and mangling to lambdas inside inline variables and ↵Richard Smith2017-09-201-1/+1
| | | | | | | | variable templates. This implements the proposed approach in https://github.com/itanium-cxx-abi/cxx-abi/issues/33 llvm-svn: 313827
* [Lit Test] Updated 20 Lit tests to be C++11 compatible.Charles Li2015-12-101-1/+10
| | | | | | | | This is the 5th Lit test patch. Expanded expected diagnostics to vary by C++ dialect. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 255196
* Fix assert instantiating string init of static variableBen Langmuir2015-01-261-0/+12
| | | | | | | | ... when the variable's type is a typedef of a ConstantArrayType. Just look through the typedef (and any other sugar). We only use the constant array type here to get the element count. llvm-svn: 227115
* Change the diagnostics which said 'accepted as an extension' to instead sayRichard Smith2011-12-291-2/+1
| | | | | | | 'is an extension'. The former is inappropriate and confusing when building with -Werror/-pedantic-errors. llvm-svn: 147357
* Mark the ExtWarn for in-class initialization of static const float members ↵Richard Smith2011-09-291-1/+1
| | | | | | as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode. llvm-svn: 140820
* constexpr: semantic checking for constexpr variables.Richard Smith2011-09-291-1/+1
| | | | | | We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier). llvm-svn: 140801
* When printing a qualified type, look through a substituted templateDouglas Gregor2011-02-171-1/+1
| | | | | | | | | | parameter type to see what's behind it, so that we don't end up printing silly things like "float const *" when "const float *" would make more sense. Also, replace the pile of "isa" tests with a simple switch enumerating all of the cases, making a few more obvious cases use prefix qualifiers. llvm-svn: 125729
* Support in-class initialization of static const floating-point data members.John McCall2010-09-101-2/+2
| | | | llvm-svn: 113663
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-2/+2
| | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. llvm-svn: 98149
* When looking for a redeclaration of a static variable, only look for ↵Douglas Gregor2010-03-011-0/+23
| | | | | | redeclarations. Fixes PR6449 llvm-svn: 97478
* use DiagRuntimeBehavior to silence the div/rem by zero warning whenChris Lattner2010-01-121-1/+1
| | | | | | not in an evaluated context. This removes some bogus warnings. llvm-svn: 93258
* implement PR6004, warning about divide and remainder by zero.Chris Lattner2010-01-121-1/+1
| | | | llvm-svn: 93256
* Improve the diagnostics used to report implicitly-generated class membersJohn McCall2010-01-061-1/+1
| | | | | | | | | as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. llvm-svn: 92832
* Switch default-initialization of variables of class type (or array thereof) ↵Douglas Gregor2009-12-201-1/+1
| | | | | | over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one llvm-svn: 91796
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* When we're building a CXXExprWithTemporaries, only include thoseDouglas Gregor2009-12-031-0/+20
| | | | | | | | | | | temporaries that are within our current evaluation context. That way, nested evaluation contexts (e.g., within a sizeof() expression) won't see temporaries from outer contexts. Also, make sure to push a new evaluation context when instantiating the initializer of a variable; this may be an unevaluated context or a potentially-evaluated context, depending on whether it's an in-class initializer or not. Fixes PR5672. llvm-svn: 90460
* Refactor our handling of expression evaluation contexts, so that SemaDouglas Gregor2009-11-261-1/+35
| | | | | | | | | | | | maintains a stack of evaluation contexts rather than having the parser do it. This change made it simpler to track in which contexts temporaries were created, so that we could... "Forget" about temporaries created within unevaluated contexts, so that we don't build a CXXExprWithTemporaries and, therefore, destroy the integral-constness of our expressions. Fixes PR5609. llvm-svn: 89908
* Update for LLVM API change.Owen Anderson2009-07-271-1/+1
| | | | llvm-svn: 77267
* When instantiating a variable without an initializer, callDouglas Gregor2009-07-271-0/+22
| | | | | | ActOnUninitializedDecl. llvm-svn: 77211
* Implement template instantiation for static data members of classDouglas Gregor2009-03-251-0/+18
templates, including in-class initializers. For example: template<typename T, T Divisor> class X { public: static const T value = 10 / Divisor; }; instantiated with, e.g., X<int, 5>::value to get the value '2'. llvm-svn: 67715
OpenPOWER on IntegriCloud