Richard Smith
6c42433ceb
Update www: clang now supports C++11 for-range and non-template type aliases.
...
llvm-svn: 129569
2011-04-15 14:38:27 +00:00
Richard Smith
dda56e4b4a
Support for C++11 (non-template) alias declarations.
...
llvm-svn: 129567
2011-04-15 14:24:37 +00:00
Richard Smith
030f499d2f
Teach -ast-print how to print template template parameters.
...
llvm-svn: 129565
2011-04-15 13:38:57 +00:00
Benjamin Kramer
3462376c65
Fix mismatched delete.
...
llvm-svn: 129564
2011-04-15 11:21:57 +00:00
Richard Smith
3504faf6e4
Apply NAKAMURA Takumi's workaround to fix thses tests on -Asserts build. The labels there are numbered, not named, and numbered labels are formatted differently.
...
llvm-svn: 129562
2011-04-15 10:12:39 +00:00
Nick Lewycky
53ba5ee4ce
Create a compiler-rt directory and move the Makefile to it. Add a makefile that
...
builds the subdirs from this directory. This makes the behaviour with make match
what already happens with cmake.
llvm-svn: 129561
2011-04-15 06:57:32 +00:00
Ted Kremenek
1551d55295
Improve diagnostics on GNU attributes by warning about attributes that should have no arguments or parameters. Patch by Michael Han!
...
llvm-svn: 129560
2011-04-15 05:49:29 +00:00
Chris Lattner
57540c5be0
fix a bunch of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Peter Collingbourne
3d9cbdc3e6
C1X: implement static asserts
...
llvm-svn: 129555
2011-04-15 00:35:57 +00:00
Peter Collingbourne
9114759641
C1X: implement generic selections
...
As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.
llvm-svn: 129554
2011-04-15 00:35:48 +00:00
Peter Collingbourne
a686b5f8bf
C1X: add a language standard
...
llvm-svn: 129553
2011-04-15 00:35:23 +00:00
Tanya Lattner
ee840b85b1
Do not expand the opencl pragma names. This is so you can also have a define named the samed as the pragma and they do not interfere (ie. cl_khr_fp64).
...
llvm-svn: 129549
2011-04-14 23:35:31 +00:00
Douglas Gregor
6ca6410e3a
If the declaration of a C++ member function with an inline definition
...
is so broken that Sema can't form a declaration for it, don't bother
trying to parse the definition later. Fixes <rdar://problem/9221993>.
llvm-svn: 129547
2011-04-14 23:19:27 +00:00
Douglas Gregor
40965fa78a
When we transform a C++ exception declaration (e.g., for template
...
instantiation), be sure to add the transformed declaration into the
current DeclContext. Also, remove the -Wuninitialized hack that works
around this bug. Fixes <rdar://problem/9200676>.
llvm-svn: 129544
2011-04-14 22:32:28 +00:00
Richard Smith
02e85f3bc5
Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).
...
llvm-svn: 129541
2011-04-14 22:09:26 +00:00
Richard Smith
55858499e2
Detect when the string "<::" is found in code after a cast or template name and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::".
...
Patch by Richard Trieu! Plus a small tweak from me to deal with one of the tokens coming from a macro.
llvm-svn: 129540
2011-04-14 21:45:45 +00:00
Douglas Gregor
7df2126000
Harden Clang's cursor visitation logic against NULL declaration,
...
statement, and expression pointers. While these shouldn't happen, it's
better to be safe in libclang.
llvm-svn: 129539
2011-04-14 21:41:34 +00:00
Fariborz Jahanian
bc2ee9382c
Match pointer of compatible vection types.
...
// rdar://9208404
llvm-svn: 129536
2011-04-14 20:33:36 +00:00
Douglas Gregor
af670a81e9
When determining the "usage" type of a declaration for the purposes of code
...
completion, look through block pointer and function pointer types to the
result type of the block/function. Fixes <rdar://problem/9282583>.
llvm-svn: 129535
2011-04-14 20:33:34 +00:00
Anton Korobeynikov
231e875b5c
Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
...
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.
In particular, all library functions should always be AAPCS regardless of floating point ABI used.
llvm-svn: 129534
2011-04-14 20:06:49 +00:00
Richard Smith
fdc33cbecd
Name mangling of late-specified return types doesn't work if the return type references the argument types:
...
template<typename T> auto f(T a) -> decltype(a.foo());
Since this is the primary reason for the introduction of this feature, downgrade implementation status to "Some examples work".
llvm-svn: 129533
2011-04-14 19:57:19 +00:00
Richard Smith
f7b6202e6c
Implement C++0x [lex.pptoken]p3's handling of <::.
...
llvm-svn: 129525
2011-04-14 18:36:27 +00:00
Douglas Gregor
23c8476748
Parse an '@' in an Objective-C++ class member specification,
...
diagnosing it as an error rather than looping infinitely. Also,
explicitly disallow @defs in Objective-C++. Fixes <rdar://problem/9260136>.
llvm-svn: 129521
2011-04-14 17:21:19 +00:00
Sebastian Redl
9ab988fe00
Chained PCH: Remember when additional specializations are added to a function template from a previous PCH. Fixes the only crasher when using massive chains on Clang's Sema component. We still have some incomplete codegen there.
...
llvm-svn: 129516
2011-04-14 14:07:59 +00:00
Sebastian Redl
05d73a10a2
Add header guards to include/clang/Basic/ConvertUTF.h.
...
llvm-svn: 129515
2011-04-14 14:07:49 +00:00
Sebastian Redl
4e52123d06
Fix -H. It was pretty broken.
...
llvm-svn: 129514
2011-04-14 14:07:45 +00:00
Sebastian Redl
eb931c6b0e
The ASTReader created by -chain-include used the generated PCH buffers in the wrong order. The effect was that all but the first chain-include files was ignored for subsequent compilations.
...
llvm-svn: 129513
2011-04-14 14:07:41 +00:00
Ted Kremenek
9eb0b7d2f1
Return the correct lastly populated block from CFGBuilder::VisitUnaryExprOrTypeTraitExpr().
...
llvm-svn: 129499
2011-04-14 01:50:50 +00:00
Ken Dyck
3563aa6520
Replace a couple of divide-by-8s with divide-by-charwidths. No change in
...
functionality intended.
llvm-svn: 129496
2011-04-14 01:00:39 +00:00
Eli Friedman
6620ddeaa4
Re-fix r129481 and r129465 properly. Nulls fixits shouldn't be dropped in
...
DiagnosticBuilder::AddFixItHint: they will be dropped along with any
other (possibly valid) fixits later.
llvm-svn: 129495
2011-04-14 00:51:41 +00:00
Argyrios Kyrtzidis
36e4ae3e57
When creating an implicit member expression through a qualified-id, check that the class
...
named by the nested-name-specifier is same or base of the class in which the member expression appears.
It seems we also had an ill-formed test case, mon dieu! Fixes rdar://8576107.
llvm-svn: 129493
2011-04-14 00:46:47 +00:00
Ken Dyck
c5ca87675e
Replace a couple of divisions-by-'8' with divisions-by-charwidth. No change
...
in functionality intended.
llvm-svn: 129491
2011-04-14 00:43:09 +00:00
Anders Carlsson
d162fb83f2
In C++, when initializing an array from a pascal string, it's OK if the array
...
is 1 element smaller than the string, because we can just strip off the last
null character. This matches GCC.
llvm-svn: 129490
2011-04-14 00:41:11 +00:00
Anders Carlsson
752454092c
Add a flag to StringLiteral to keep track of whether the string is a pascal string or not.
...
llvm-svn: 129488
2011-04-14 00:40:03 +00:00
Anders Carlsson
a5a9bafeb9
Rename test.
...
llvm-svn: 129486
2011-04-13 23:55:47 +00:00
Chandler Carruth
a7773f719e
Add -no-canonical-prefixes to tests which assert on the name of the
...
built clang binary that is used by the test. Build systems that use
symlinks for build outputs will fail these assertions otherwise.
llvm-svn: 129482
2011-04-13 22:28:36 +00:00
Fariborz Jahanian
38675543c5
Issue the 2nd fixit even if fix-it hint is supressed.
...
// rdar://9091893
llvm-svn: 129481
2011-04-13 22:18:37 +00:00
Ted Kremenek
13b5a2c2f8
Add Objective-C++ files to those accepted by ccc-analyzer.
...
llvm-svn: 129475
2011-04-13 21:52:05 +00:00
Ted Kremenek
7114954232
Update public analyzer build to checker-256.
...
llvm-svn: 129473
2011-04-13 21:48:34 +00:00
Fariborz Jahanian
e72509c10c
No fixit hint for builtin expressions which are
...
defined in a macro. // rdar://9091893
llvm-svn: 129465
2011-04-13 20:31:26 +00:00
Bill Wendling
a865185ad6
Removing the unaligned load tests from builtins-x86.c since they're generated by a regular 'load' now.
...
llvm-svn: 129464
2011-04-13 20:17:22 +00:00
Axel Naumann
43dec14079
From Vassil Vassilev: Give external source's last resort lookup a chance, even if an identifier could resolve to a builtin.
...
llvm-svn: 129438
2011-04-13 13:19:46 +00:00
Bill Wendling
2c1c33552d
Remove comment that snuck in there.
...
llvm-svn: 129434
2011-04-13 10:05:14 +00:00
Bill Wendling
88ae43772a
It looks like the FreeBSD buildbot needs this for the builtins-x86.c test.
...
llvm-svn: 129433
2011-04-13 10:02:54 +00:00
Chandler Carruth
0a7aa3b60b
Teach -Wuninitialized about C++'s typeid expression, including both the
...
evaluated and unevaluated contexts. Add some testing of sizeof and
typeid.
Both of the typeid tests added here were triggering warnings previously.
Now the one false positive is suppressed without suppressing the warning
on actually buggy code.
llvm-svn: 129431
2011-04-13 08:18:42 +00:00
Argyrios Kyrtzidis
71c58f3d59
Collect the options applicable to the Rewriter methods into a RewriterOptions struct.
...
llvm-svn: 129430
2011-04-13 07:15:11 +00:00
Bill Wendling
b9c9e34cb3
Just use a native "load" instead of translating the builtin later. Clang can
...
take it!
I wasn't able to get __builtin_ia32_loaddqu to transform into an unaligned
load...I'll have to look into it further.
llvm-svn: 129427
2011-04-13 05:58:17 +00:00
Francois Pichet
efc283c076
Still not used to put the * next to the variable name.
...
llvm-svn: 129426
2011-04-13 02:44:57 +00:00
Francois Pichet
48c946e5ef
In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning. Up to now this is the only case I found where MSVC doesn't require "typename" at class scope. Really strange!
...
This fixes 1 error when parsing the MSVC 2008 header files.
Example:
template<class T> class A {
public:
typedef int TYPE;
};
template<class T> class B : public A<T> {
public:
A<T>::TYPE a; // no typename required because A<T> is a base class.
};
llvm-svn: 129425
2011-04-13 02:38:49 +00:00
Anders Carlsson
bbe277c4a9
Use EmitCallOrInvoke in EmitBadTypeidCall and EmitBadCastCall.
...
llvm-svn: 129424
2011-04-13 02:35:36 +00:00