| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
and give that category an explicit test. Generalize the internal diagnostic
name.
llvm-svn: 86905
|
| |
|
|
|
|
|
|
|
|
|
| |
annotation token, because some of the tokens we're annotating might
not be in the set of cached tokens (we could have consumed them
unconditionally).
Also, move the tentative parsing from ParseTemplateTemplateArgument
into the one caller that needs it, improving recovery.
llvm-svn: 86904
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
permits, among other things, ripping apart and reconstructing
templates via partial specialization:
template<typename T>
struct DeepRemoveConst { typedef T type; };
template<typename T>
struct DeepRemoveConst<const T> {
typedef typename DeepRemoveConst<T>::type type;
};
template<template<typename> class TT, typename T>
struct DeepRemoveConst<TT<T> > {
typedef TT<typename DeepRemoveConst<T>::type> type;
};
Also, fix a longstanding thinko in the code handling partial ordering
of class template partial specializations. We were performing the
second deduction without clearing out the results of the first
deduction. It's amazing we got through so much code with such a
horrendous error :(
llvm-svn: 86893
|
| |
|
|
|
|
| |
the -Wconversion check.
llvm-svn: 86891
|
| |
|
|
| |
llvm-svn: 86890
|
| |
|
|
| |
llvm-svn: 86888
|
| |
|
|
|
|
|
| |
either both synthesized or bith user defined.
Implements radar 6557233.
llvm-svn: 86887
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with its corresponding template parameter. This can happen when we
performed some substitution into the default template argument and
what we had doesn't match any more, e.g.,
template<int> struct A;
template<typename T, template<T> class X = A> class B;
B<long> b;
Previously, we'd emit a pretty but disembodied diagnostic showing how
the default argument didn't match the template parameter. The
diagnostic was good, but nothing tied it to the *use* of the default
argument in "B<long>". This commit fixes that.
Also, tweak the counting of active template instantiations to avoid
counting non-instantiation records, such as those we create for
(surprise!) checking default arguments, instantiating default
arguments, and performing substitutions as part of template argument
deduction.
llvm-svn: 86884
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
template template parameter, substitute any prior template arguments
into the template template parameter. This, for example, allows us to
properly check the template template argument for a class such as:
template<typename T, template<T Value> class X> struct Foo;
The actual implementation of this feature was trivial; most of the
change is dedicated to giving decent diagnostics when this
substitution goes horribly wrong. We now get a note like:
note: while substituting prior template arguments into template
template parameter 'X' [with T = float]
As part of this change, enabled some very pedantic checking when
comparing template template parameter lists, which shook out a bug in
our overly-eager checking of default arguments of template template
parameters. We now perform only minimal checking of such default
arguments when they are initially parsed.
llvm-svn: 86864
|
| |
|
|
|
|
| |
initializer list. Fixes PR5463.
llvm-svn: 86849
|
| |
|
|
|
|
| |
was commented out.
llvm-svn: 86845
|
| |
|
|
|
|
|
|
|
| |
template<typename T>
struct X {
template<template<T Value> class Y> struct Inner;
};
llvm-svn: 86844
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nested-name-specifiers so that they don't gobble the template name (or
operator-function-id) unless there is also a
template-argument-list. For example, given
T::template apply
we would previously consume both "template" and "apply" as part of
parsing the nested-name-specifier, then error when we see that there
is no "<" starting a template argument list. Now, we parse such
constructs tentatively, and back off if the "<" is not present. This
allows us to parse dependent template names as one would use them for,
e.g., template template parameters:
template<typename T, template<class> class X = T::template apply>
struct MetaSomething;
Also, test default arguments for template template parameters.
llvm-svn: 86841
|
| |
|
|
| |
llvm-svn: 86837
|
| |
|
|
|
|
| |
Now only one test case is XFAIL'ed.
llvm-svn: 86834
|
| |
|
|
|
|
| |
determine if a pointer is casted to a struct pointer. This fixes an observed false positive when a value is casted to a union.
llvm-svn: 86813
|
| |
|
|
| |
llvm-svn: 86801
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- FileCheck is a *huuuuge* improvement here.
- Still feels like we could use a better tool for this though, either teach
llvm-dis to spit out the FileCheck syntax, or provide another tool to turn a
.ll into a "matchable" input.
- Also on my Christmas list is better FileCheck diagnostics with missing
variables or mismatches.
llvm-svn: 86800
|
| |
|
|
|
|
|
| |
if (self = [super init])
Recognize it and only warn if -Wparentheses is explicitly enabled.
llvm-svn: 86790
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parameters. Rather than storing them as either declarations (for the
non-dependent case) or expressions (for the dependent case), we now
(always) store them as TemplateNames.
The primary change here is to add a new kind of TemplateArgument,
which stores a TemplateName. However, making that change ripples to
every switch on a TemplateArgument's kind, also affecting
TemplateArgumentLocInfo/TemplateArgumentLoc, default template
arguments for template template parameters, type-checking of template
template arguments, etc.
This change is light on testing. It should fix several pre-existing
problems with template template parameters, such as:
- the inability to use dependent template names as template template
arguments
- template template parameter default arguments cannot be
instantiation
However, there are enough pieces missing that more implementation is
required before we can adequately test template template parameters.
llvm-svn: 86777
|
| |
|
|
| |
llvm-svn: 86764
|
| |
|
|
| |
llvm-svn: 86755
|
| |
|
|
|
|
| |
generated PHI node for the null check of a new operator.
llvm-svn: 86738
|
| |
|
|
|
|
| |
<rdar://problem/7381735>.
llvm-svn: 86731
|
| |
|
|
|
|
| |
global array of objects.
llvm-svn: 86701
|
| |
|
|
|
|
|
|
|
| |
using directives, and fix a bug thereby exposed: since we're playing
tricks with pointers, we need to make certain we're always using the same
pointers for things.
Also tweak an existing error message.
llvm-svn: 86679
|
| |
|
|
| |
llvm-svn: 86674
|
| |
|
|
|
|
| |
This is a pretty minimal test case; I'll make a better one later.
llvm-svn: 86669
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
or a pointer to an NSString, emit a code insertion hint that turns it into an Objective-C string. For example:
@class NSString;
@interface Test
+ (void)test:(NSString *)string;
@end
void g(NSString *a);
void f() {
NSString *a = "Foo";
g("Foo");
[Test test:"Foo"];
}
will produce
t.m:10:17: warning: incompatible pointer types initializing 'char [4]', expected 'NSString *'
NSString *a = "Foo";
^~~~~
@
t.m:11:5: warning: incompatible pointer types passing 'char [4]', expected 'NSString *'
g("Foo");
^~~~~
@
t.m:12:14: warning: incompatible pointer types sending 'char [4]', expected 'NSString *'
[Test test:"Foo"];
^~~~~
@
3 diagnostics generated.
llvm-svn: 86665
|
| |
|
|
|
|
| |
has a defualt argument then add a fixit hint that removes the default argument. Fixes PR5444.
llvm-svn: 86659
|
| |
|
|
| |
llvm-svn: 86657
|
| |
|
|
|
|
| |
region, so that arithmetic within a memory chunk is allowed.
llvm-svn: 86652
|
| |
|
|
| |
llvm-svn: 86607
|
| |
|
|
|
|
|
| |
warning, to match gcc. It used to be warning, so
better keep it a warning (it broke a certain project).
llvm-svn: 86597
|
| |
|
|
|
|
|
| |
when looking for a name within a given DeclContext. Now enumerators
will show up in code-completion results.
llvm-svn: 86591
|
| |
|
|
|
|
| |
its element type. Fixes pr5432.
llvm-svn: 86587
|
| |
|
|
|
|
| |
overloaded operator().
llvm-svn: 86581
|
| |
|
|
|
|
|
| |
declaration invalid if the constructor can't be properly built. Addresses
remaining review comments from Fariborz for r86500.
llvm-svn: 86579
|
| |
|
|
|
|
|
|
|
| |
templates. The instantiation of these default arguments must be (and
now, is) delayed until the template argument is actually used, at
which point we substitute all levels of template arguments
concurrently.
llvm-svn: 86578
|
| |
|
|
| |
llvm-svn: 86574
|
| |
|
|
| |
llvm-svn: 86573
|
| |
|
|
|
|
|
|
| |
unless we start implementing command-line switches which override the default
calling convention, so the effect is mostly to silence unknown attribute
warnings.)
llvm-svn: 86571
|
| |
|
|
|
|
| |
nested templates, for my own sanity's sake
llvm-svn: 86570
|
| |
|
|
| |
llvm-svn: 86563
|
| |
|
|
| |
llvm-svn: 86561
|
| |
|
|
| |
llvm-svn: 86552
|
| |
|
|
|
|
| |
inclusion of missing headers
llvm-svn: 86551
|
| |
|
|
|
|
|
|
| |
- Provide an actual test for code-completion via CIndex.
- Actually print optional strings in c-index-test
- Export clang_getCompletionChunkCompletionString from CIndex
llvm-svn: 86550
|
| |
|
|
| |
llvm-svn: 86541
|
| |
|
|
| |
llvm-svn: 86538
|