Richard Smith
91dfaacd38
Implement DR329. We already did the right thing here in C++98 mode, but r104014
...
(which implemented the DR) was disabled in C++11.
llvm-svn: 200673
2014-02-03 02:37:59 +00:00
Richard Smith
3dd73db411
Move away from 'general' / 'generalized' as a way of identifying C++11
...
attribute syntax. There's nothing generalized about this; it's one of
several first-class attribute syntaxes we support, all of which are
more-or-less equally general.
As discussed on cfe-commits, we may want to revisit this if we start allowing
this syntax as an extension in C (or if C adopts the syntax), but hopefully
this diagnostic wording will be crystal clear to everyone in the mean time.
llvm-svn: 199443
2014-01-17 00:11:48 +00:00
Alp Toker
44e3905987
Clarify warn_cxx98_compat_attribute diagnostic
...
Various attribute flavours are supported in C++98. Make it clear that this
compatibility warning relates specifically to C++11-style generalized
attributes.
llvm-svn: 199053
2014-01-12 15:18:06 +00:00
Nick Lewycky
5641233047
Use the appropriate SourceLocation for the template backtrace when doing
...
template argument deduction.
llvm-svn: 198995
2014-01-11 02:37:12 +00:00
Richard Smith
fde9485297
Implement C++1y digit separator proposal (' as a digit separator). This is not
...
yet approved by full committee, but was unanimously supported by EWG.
llvm-svn: 191417
2013-09-26 03:33:06 +00:00
Larisse Voufo
39a1e507ff
Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...
...
llvm-svn: 187762
2013-08-06 01:03:05 +00:00
Richard Smith
070a5d6750
Undisable a test for a c++98-compat warning for inheriting constructors now that we implement them.
...
llvm-svn: 186768
2013-07-20 19:22:08 +00:00
Richard Smith
72752e88ef
Fix handling of braced-init-list as reference initializer within aggregate
...
initialization. Previously we would incorrectly require an extra set of braces
around such initializers.
llvm-svn: 182983
2013-05-31 02:56:17 +00:00
Richard Smith
d0c842d7a4
Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add a
...
testcase for a situation it caused us to miss.
llvm-svn: 173540
2013-01-26 00:39:02 +00:00
Richard Smith
a7edaad3b6
Only produce one -Wc++98-compat warning when initializing a reference from an init list with multiple elements.
...
llvm-svn: 172285
2013-01-12 01:05:20 +00:00
Richard Smith
92f241f188
Properly compute triviality for explicitly-defaulted or deleted special members.
...
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.
This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.
This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.
llvm-svn: 169667
2012-12-08 02:53:02 +00:00
Michael Han
64536a6d25
Teach Clang parser to reject C++11 attributes that appertain to declaration specifiers.
...
We don't support any C++11 attributes that appertain to declaration specifiers so reject
the attributes in parser until we support them; this also conforms to what g++ 4.8 is doing.
llvm-svn: 167481
2012-11-06 19:34:54 +00:00
Douglas Gregor
a3d3fe9be6
The presence of a user-*declared* constructor makes the default
...
constructor not user provided (and, therefore, non-trivial). Fixes
<rdar://problem/11736429>.
llvm-svn: 162947
2012-08-30 21:47:37 +00:00
Benjamin Kramer
e3895eb050
Use the location of the copy assignment when diagnosing classes that are nontrivial because of it.
...
llvm-svn: 160962
2012-07-30 16:41:40 +00:00
Benjamin Kramer
bc7dd9ea02
Fix ambiguity detection in GetBestOverloadCandidateSimple.
...
When performing the simplistic overload resolution for single-argument methods,
don't check the best overload for ambiguity with itself when the best overload
doesn't happen to be the first one.
Fixes PR13480.
llvm-svn: 160961
2012-07-30 15:53:26 +00:00
Richard Smith
fa139cd3bd
Remove -Wc++98-compat warning for an outrageously-rare circumstance of 'this'
...
being used in an exception specification in a way which isn't otherwise
ill-formed in C++98: this warning also incorrectly triggered on uses of 'this'
inside thread-safety attributes, and the mechanism required to tell these cases
apart is more complex than can be justified by the (minimal) value of this part
of -Wc++98-compat.
llvm-svn: 155857
2012-04-30 23:33:33 +00:00
Richard Smith
d494c500a0
PR12224 (sort of): Diagnose inheriting constructor declarations in C++11 mode.
...
We do not support IRGen for these, and get some parts of the semantic analysis
wrong.
llvm-svn: 155728
2012-04-27 19:33:05 +00:00
Richard Smith
bc8c5b5d67
Two missing -Wc++98-compat warnings, for null pointers as non-type template
...
arguments, and 'this' in exception-specifications.
llvm-svn: 155606
2012-04-26 01:51:03 +00:00
Richard Smith
2b349aee5b
Add missing -Wc++98-compat warnings for initializer list initializations which
...
initialize references, create std::initializer_list objects, or call constructors.
llvm-svn: 155105
2012-04-19 06:58:00 +00:00
Richard Smith
9380e0ea23
Implement C++11 [temp.arg.nontype]'s permission to use the address of an object
...
or function with internal linkage as a non-type template argument.
llvm-svn: 154053
2012-04-04 21:11:30 +00:00
Richard Smith
852265ff1c
PR10217: Provide diagnostics explaining why an implicitly-deleted special
...
member function is deleted.
llvm-svn: 153773
2012-03-30 20:53:28 +00:00
Sebastian Redl
6db0b1bfed
Fix the other place where C++98 work for initializer lists was necessary.
...
llvm-svn: 153129
2012-03-20 21:24:03 +00:00
Sebastian Redl
1678d5f7b2
Add the missing compatibility warning for braced initializers as default arguments.
...
llvm-svn: 153026
2012-03-18 22:25:45 +00:00
Richard Smith
2a70e65436
Improve diagnostics for UCNs referring to control characters and members of the
...
basic source character set in C++98. Add -Wc++98-compat diagnostics for same in
literals in C++11. Extend such support to cover string literals as well as
character literals, and mark N2170 as done.
This seems too minor to warrant a release note to me. Let me know if you disagree.
llvm-svn: 152444
2012-03-09 22:27:51 +00:00
Richard Smith
e18f0faff2
Lexing support for user-defined literals. Currently these lex as the same token
...
kinds as the underlying string literals, and we silently drop the ud-suffix;
those issues will be fixed by subsequent patches.
llvm-svn: 152012
2012-03-05 04:02:15 +00:00
Richard Smith
2fbb3d84a2
Tests for r151508.
...
llvm-svn: 151509
2012-02-26 23:49:01 +00:00
Richard Smith
2a986117e9
Fix r151443 to only apply C++11's exception for non-static data member access
...
in cases where we would otherwise disallow the access, and add a -Wc++98-compat
diagnostic for this C++11 feature.
llvm-svn: 151444
2012-02-25 10:20:59 +00:00
Richard Smith
fd3da9358f
__decltype is a GNU extension, not a C++11 extension.
...
llvm-svn: 151377
2012-02-24 18:10:23 +00:00
Richard Smith
4297375561
C++11 allows unions to have static data members. Remove the corresponding
...
restriction and add some tests.
llvm-svn: 150721
2012-02-16 20:41:22 +00:00
Sebastian Redl
d74dd49065
Proper initializer list support for new expressions and type construct expressions. Array new still missing.
...
llvm-svn: 150346
2012-02-12 18:41:05 +00:00
Sebastian Redl
82ace98d55
Fix parsing new expressions using init lists. Probably still do the wrong thing in cases involving array new.
...
Show that many cases using initializer list constructors work, in that they parse and pass semantic analysis.
llvm-svn: 150316
2012-02-11 23:51:08 +00:00
Eli Friedman
c7c97144af
Stub out the Sema interface for lambda expressions, and change the parser to use it. Unconditionally error on lambda expressions because they don't work in any meaningful way yet.
...
llvm-svn: 147515
2012-01-04 02:40:39 +00:00
Richard Smith
fe2750db42
Add -Wc++98-compat diagnostics for jumps which bypass initialization of non-POD
...
but trivially constructible and destructible variables in C++11 mode. Also
incidentally improve the precision of the wording for jump diagnostics in C++98
mode.
llvm-svn: 142619
2011-10-20 21:42:12 +00:00
Richard Smith
91c7bbde4b
Add -Wc++98-compat warning for enumerations in nested name specifiers.
...
llvm-svn: 142568
2011-10-20 03:28:47 +00:00
Richard Smith
f720df0ed6
-Wc++98-compat: warn on nontrivial types used in unions and anonymous structs.
...
llvm-svn: 142541
2011-10-19 20:41:51 +00:00
Richard Smith
c620f554b9
-Wc++98-compat: diagnose if a reference is bound to a prvalue which does not
...
have an unambiguous accessible copying constructor; this is ill-formed in C++98.
llvm-svn: 142533
2011-10-19 16:55:56 +00:00
Richard Smith
a066ccfcf1
Add a -Wc++98-compat warning for friend functions of class templates which would
...
be implicitly instantiated (resulting in a redefinition) in C++98.
llvm-svn: 142468
2011-10-19 00:54:10 +00:00
Richard Smith
38c0e0417c
-Wc++98-compat: warn if a SFINAE substitution in C++11 suppresses an access
...
control diagnostic.
llvm-svn: 142463
2011-10-19 00:07:01 +00:00
Richard Smith
c82397332d
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 2.
...
llvm-svn: 142426
2011-10-18 21:39:00 +00:00
Richard Smith
0bf8a492fd
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.
...
llvm-svn: 142419
2011-10-18 20:49:44 +00:00
Richard Smith
b15c11c819
Add -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',
...
'char32_t', 'constexpr', 'decltype', 'noexcept', 'nullptr' and 'static_assert'.
llvm-svn: 142302
2011-10-17 23:06:20 +00:00
Richard Smith
e41fac231c
Add -Wc++98-compat warning for deduced 'auto' type specifier.
...
llvm-svn: 142057
2011-10-15 05:42:01 +00:00
Richard Smith
5d164bc5e0
Implement -Wc++98-compat warnings for the parser.
...
llvm-svn: 142056
2011-10-15 05:09:34 +00:00
Richard Smith
acd4d3d52a
-Wc++98-compat warnings for the lexer.
...
This also adds a -Wc++98-compat-pedantic for warning on constructs which would
be diagnosed by -std=c++98 -pedantic (that is, it warns even on C++11 features
which we enable by default, with no warning, in C++98 mode).
llvm-svn: 142034
2011-10-15 01:18:56 +00:00
Richard Smith
f679b5b6a6
-Wc++98-compat: warn on C++11 attributes and alignas.
...
llvm-svn: 141999
2011-10-14 20:48:27 +00:00
Richard Smith
2b6b0ee6d1
Test for r141985.
...
llvm-svn: 141998
2011-10-14 20:41:13 +00:00
Jeffrey Yasskin
de8a104633
Revert the -Wc++98-compat flag because dgregor doesn't like it.
...
llvm-svn: 141921
2011-10-14 00:04:00 +00:00
Richard Smith
465f069b93
Convert newly-added test from -std=c++0x to -std=c++11.
...
llvm-svn: 141904
2011-10-13 22:45:21 +00:00
Jeffrey Yasskin
a722170eb9
Implement the first piece of a -Wc++98-compat flag so that people can build in
...
C++11 mode but keep their sources compatible with C++98. This patch implements
the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include
it.
llvm-svn: 141898
2011-10-13 22:18:05 +00:00