Douglas Gregor
aa49ecc458
Not content to implement just "extern" explicit template
...
instantiations, GCC also supports "inline" and "static" explicit
template instantiations. Parse and warn about such constructs, but
don't implement the semantics of either "inline" or "static". They
don't seem to be widely used.
llvm-svn: 120599
2010-12-01 20:32:20 +00:00
Douglas Gregor
d1f69f6a1d
After parsing a ':' in an enum-specifier within class context,
...
disambiguate between an expression (for a bit-field width) and a type
(for a fixed underlying type). Since the disambiguation can be
expensive (due to tentative parsing), we perform a simplistic
disambiguation based on one-token lookahead before going into the
full-blown tentative parsing. Based on a patch by Daniel Wallin.
llvm-svn: 120582
2010-12-01 17:42:47 +00:00
John McCall
f3735e01ce
Restore the lvalue-to-rvalue conversion patch with a minimal fix.
...
llvm-svn: 120555
2010-12-01 04:43:34 +00:00
Peter Collingbourne
8f6218bfa0
test: add .cu extension
...
llvm-svn: 120553
2010-12-01 04:22:41 +00:00
Peter Collingbourne
6ab610ce57
Basic, Sema: add support for CUDA location attributes
...
llvm-svn: 120545
2010-12-01 03:15:31 +00:00
Douglas Gregor
e2e50d331c
Implement AST import support for class template specializations.
...
llvm-svn: 120523
2010-12-01 01:36:18 +00:00
Fariborz Jahanian
68500913ec
When unknown method is sent to a receiver of
...
'Class' type, disgnostic should refere to a
class method. Fixes // rdar://8592156
llvm-svn: 120517
2010-12-01 01:07:24 +00:00
Fariborz Jahanian
3a4ea9a76c
Declaring local static in global block
...
literal declaration caused crash in CodeGen.
This patch fixes it. pr8707
llvm-svn: 120486
2010-11-30 23:07:14 +00:00
Argyrios Kyrtzidis
e72f7154f1
Follow through references to catch returned stack addresses, local blocks, label addresses or references to temporaries, e.g:
...
const int& g2() {
int s1;
int &s2 = s1; // expected-note {{binding reference variable 's2' here}}
return s2; // expected-warning {{reference to stack memory associated with local variable 's1' returned}}
}
llvm-svn: 120483
2010-11-30 22:57:32 +00:00
Douglas Gregor
a082a49d9e
Implement basic AST importing and merging support for class template
...
declarations.
llvm-svn: 120448
2010-11-30 19:14:50 +00:00
Fariborz Jahanian
1fdbaa84aa
Add objc_getClass as an objc builtin function
...
(// rdar://8592641). Also rename LANGUAGEID to
LanguageID.
llvm-svn: 120437
2010-11-30 18:25:34 +00:00
Douglas Gregor
f88e35ba0b
When using a precompiled preamble with detailed preprocessing records,
...
trap the serialized preprocessing records (macro definitions, macro
instantiations, macro definitions) from the generation of the
precompiled preamble, then replay those when walking the list of
preprocessed entities. This eliminates a bug where clang_getCursor()
wasn't able to find preprocessed-entity cursors in the preamble.
llvm-svn: 120396
2010-11-30 06:16:57 +00:00
Nico Weber
ebd45a004d
Fix bug in r120299 spotted by dgregor.
...
llvm-svn: 120389
2010-11-30 04:44:33 +00:00
John McCall
4cec5f806b
Fix another case of giving the wrong value kind to a dependent cast to
...
a non-dependent type.
llvm-svn: 120384
2010-11-30 02:05:44 +00:00
Nick Lewycky
5421621d2b
Replace \r\n with \n. No functional change.
...
llvm-svn: 120379
2010-11-30 01:47:38 +00:00
Argyrios Kyrtzidis
091d97c709
Revert r120331 since it causes spurious warnings and a possible assertion hit when self-host.
...
llvm-svn: 120351
2010-11-29 23:42:03 +00:00
Fariborz Jahanian
e1802eefac
Incomplete enum types not to be treated as integer type
...
when checking for integer signed/unsigned-ness. PR8694,
// rdar://8707031
llvm-svn: 120345
2010-11-29 23:18:09 +00:00
Argyrios Kyrtzidis
569cad9734
Emit warnings if we are returning a reference to a local temporary.
...
The issue was brought to our attention by Matthieu Monrocq.
llvm-svn: 120331
2010-11-29 22:32:08 +00:00
Nico Weber
44887f69d5
Always use a function's decl context when building default arguments. Fixes http://http://llvm.org/pr8479 .
...
llvm-svn: 120299
2010-11-29 18:19:25 +00:00
John McCall
032092ffc2
Revert r120063, it was wrong.
...
llvm-svn: 120296
2010-11-29 18:01:58 +00:00
Douglas Gregor
6399366d17
Add a test for C++ [stmt.label]p1, from Sashan!
...
llvm-svn: 120291
2010-11-29 16:37:40 +00:00
NAKAMURA Takumi
c66906a6cb
test/CMakeLists.txt: Implement the target "check-all". For now, it has no dependencies.
...
llvm-svn: 120280
2010-11-29 01:18:56 +00:00
Nico Weber
dcf6fc5dc4
Revert parts of r120266 that I did not mean to commit
...
llvm-svn: 120267
2010-11-28 22:58:38 +00:00
Nico Weber
20c9f1db48
Minor whitespace and comment fixes. No functionality change.
...
llvm-svn: 120266
2010-11-28 22:53:37 +00:00
Anders Carlsson
66bbf50877
Look through parentheses when deciding whether an expr is a temporary object. Fixes PR8683.
...
llvm-svn: 120247
2010-11-28 16:40:49 +00:00
Sebastian Redl
002a3c506a
Forgot a file in r120182
...
llvm-svn: 120184
2010-11-26 18:37:14 +00:00
Sebastian Redl
346203105f
Allow access to non-static members without an object in sizeof expressions, in C++0x. Patch by Jakub Wieczorek.
...
llvm-svn: 120182
2010-11-26 16:28:07 +00:00
John McCall
29ac8e2ecd
For internal consistency's sake, compute the value kind of a dependent cast
...
based on the known properties of the casted-to type. Fixes a crash on spirit.
llvm-svn: 120180
2010-11-26 10:57:22 +00:00
Zhongxing Xu
ec0b8e32ee
Regionstore: support derived-to-base cast by creating a CXXBaseObjectRegion.
...
llvm-svn: 120173
2010-11-26 08:21:53 +00:00
Zhongxing Xu
33f13595c9
handle CXXFunctionalCastExpr in visitLValue and Environment.
...
llvm-svn: 120143
2010-11-25 03:18:57 +00:00
Nick Lewycky
ef4f456866
Tie DefineVTablesUsed() in with recursive function instantiation so that we emit
...
a useful template instantiation stack. Fixes PR8640.
This also causes a slight change to where the "instantianted from" note shows up
in truly esoteric cases (see the change to test/SemaCXX/destructor.cpp), but
that isn't directly the fault of this patch.
llvm-svn: 120135
2010-11-25 00:35:20 +00:00
Anders Carlsson
0c75b49dc1
Fix a (probably very old) regression where we weren't using the typedef name for anonymous tag types.
...
llvm-svn: 120113
2010-11-24 21:05:09 +00:00
Zhongxing Xu
8be65a792f
When getting CXXThisRegion from CXXMethodDecl, use the qualifiers. This is
...
to be consistent with the type of 'this' expr in the method.
此行及以下内容将会被忽略--
M test/Analysis/method-call.cpp
M include/clang/Checker/PathSensitive/GRExprEngine.h
M lib/Checker/GRCXXExprEngine.cpp
llvm-svn: 120094
2010-11-24 13:48:50 +00:00
John McCall
8a1013f8c3
Redeclarations of using declarations are not okay in function scopes.
...
Not sure what I was thinking before.
Fixes PR8668.
llvm-svn: 120063
2010-11-23 22:03:51 +00:00
John McCall
20c00e0e7b
This test does not need to test the alignment of pointers. Make it pass
...
on 64-bit systems.
llvm-svn: 120014
2010-11-23 10:15:48 +00:00
Francois Pichet
ce87a7e45c
long => int to make the test pass on system where sizeof(long) = 64.
...
llvm-svn: 120005
2010-11-23 07:15:13 +00:00
Francois Pichet
0c71f6c5d3
Microsoft C anonymous struct implementation.
...
Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx
llvm-svn: 120000
2010-11-23 06:07:27 +00:00
Nico Weber
13c13d4da8
Remove one I just added, add a more focused test for why the current code is correct.
...
llvm-svn: 119969
2010-11-22 13:12:28 +00:00
Nico Weber
774303425b
Fix the source range of CXXNewExprs. Fixes http://llvm.org/pr8661 .
...
llvm-svn: 119966
2010-11-22 10:30:56 +00:00
NAKAMURA Takumi
3c3b3a7d8b
test/Sema/x86-builtin-palignr.c: Now we can remove XFAIL:win32, according to r119958.
...
llvm-svn: 119961
2010-11-22 09:29:49 +00:00
Zhanyong Wan
6dace61730
Fix PR8419. Reviewed by kremenek and xuzhongxing.
...
llvm-svn: 119960
2010-11-22 08:45:56 +00:00
Chandler Carruth
45c2fb1e69
Undo part of my previous commit to mm_malloc.h, going back to the use of
...
stdlib.h. There were numerous problems with forward declaring 'malloc' and
'free', but the most important is that these are reserved by POSIX and may be
implemented via a function-like macro.
As suggested by Dale Johannesen, I'm instead guarding the only include of this
in our builtin headers with __STDC_HOSTED__, and I've removed the include of
the header from the test suite. I'll discuss with folks whether we want to have
a hosted section of the test suite or not, and add it (and perhaps other tests)
back there if that's the direction.
llvm-svn: 119958
2010-11-22 08:06:31 +00:00
Anders Carlsson
a369f8dc3a
The 'X' printf type has a valid alternative form. Fixes PR8641.
...
llvm-svn: 119946
2010-11-21 18:34:21 +00:00
Zhongxing Xu
2c966716ff
Handle CFGAutomaticObjDtor.
...
llvm-svn: 119897
2010-11-20 06:53:12 +00:00
Argyrios Kyrtzidis
90ee2a4ecf
Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:
...
if (condition)
CALL(0); // empty macro but don't warn for empty body.
Fixes rdar://8436021.
llvm-svn: 119838
2010-11-19 20:54:25 +00:00
Fariborz Jahanian
e7d62020a7
objc_msgSend is not a builtin type in non-objc mode.
...
Fixes //rdar://8686888
llvm-svn: 119813
2010-11-19 18:16:46 +00:00
Douglas Gregor
3a001f48e4
When parsing something that looks like an ill-formed
...
protocol-qualifier list without a leading type (e.g., <#blah#>), don't
complain about it being an archaic protocol-qualifier list unless it
actually parses as one.
llvm-svn: 119805
2010-11-19 17:10:50 +00:00
Douglas Gregor
a750e8e6d8
Extend the libclang diagnostic API to provide information about the
...
option name, category ID, and category name corresponding to a diagnostic.
llvm-svn: 119802
2010-11-19 16:18:16 +00:00
Fariborz Jahanian
148d113e55
Fix a bug where write-barriers for assignment through reference
...
types was not being generated for objc pointers.
// rdar://8681766.
llvm-svn: 119751
2010-11-18 22:39:16 +00:00
John McCall
4bc41aee2b
Add an assertion, fix a whole bunch of bugs, comment the assertion
...
out because there are still bugs left.
llvm-svn: 119722
2010-11-18 19:01:18 +00:00