Commit Graph

9 Commits

Author SHA1 Message Date
Eli Friedman 4e28b26589 sizeof(void) etc. should be a hard error in C++.
PR16872.

llvm-svn: 188324
2013-08-13 22:26:42 +00:00
NAKAMURA Takumi 6223834f1f clang/test/SemaCXX/dcl_ambig_res.cpp: [PR13819] It requires LP64 for now due to __SIZE_TYPE__.
llvm-svn: 163700
2012-09-12 10:45:46 +00:00
Richard Smith 943c440455 Improvements to vexing-parse warnings. Make the no-parameters case more
accurate by asking the parser whether there was an ambiguity rather than trying
to reverse-engineer it from the DeclSpec. Make the with-parameters case have
better diagnostics by using semantic information to drive the warning,
improving the diagnostics and adding a fixit.

Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
declarations of the form 'T (*x)(...)', which seem to have a very high false
positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.

llvm-svn: 160998
2012-07-30 21:30:52 +00:00
Argyrios Kyrtzidis ac3b3e8781 Handle parameter attributes when tentative parsing for function/variable disambiguation.
Fixes rdar://8739801.

llvm-svn: 121228
2010-12-08 02:02:46 +00:00
Douglas Gregor e6565625f4 Migrate the mish-mash of declaration checks in
Sema::ActOnUninitializedDecl over to InitializationSequence (with
default initialization), eliminating redundancy. More importantly, we
now check that a const definition in C++ has an initilizer, which was
an #if 0'd code for many, many months. A few other tweaks were needed
to get everything working again:

  - Fix all of the places in the testsuite where we defined const
    objects without initializers (now that we diagnose this issue)
  - Teach instantiation of static data members to find the previous
    declaration, so that we build proper redeclaration
    chains. Previously, we had the redeclaration chain but built it
    too late to be useful, because...
  - Teach instantiation of static data member definitions not to try
    to check an initializer if a previous declaration already had an
    initializer. This makes sure that we don't complain about static
    const data members with in-class initializers and out-of-line
    definitions.
  - Move all of the incomplete-type checking logic out of
    Sema::FinalizeDeclaratorGroup; it makes more sense in
    ActOnUnitializedDecl.

There may still be a few places where we can improve these
diagnostics. I'll address that as a separate commit.

llvm-svn: 95657
2010-02-09 07:26:29 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- 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
2009-12-15 20:14:24 +00:00
Sebastian Redl 9f831dbbcd Implement C++ semantics for C-style and functional-style casts. This regresses Clang extension conversions, like vectors, but allows conversions via constructors and conversion operators.
Add custom conversions to static_cast.

llvm-svn: 77076
2009-07-25 15:41:38 +00:00
Argyrios Kyrtzidis 33c70c9388 Consider nested-names as part of the declarator when resolving an ambiguous statement.
llvm-svn: 76583
2009-07-21 17:05:03 +00:00
Douglas Gregor 1bbffbceae Big update to the C++ status table to reflect "recent"
development. Still much more to write!

llvm-svn: 71167
2009-05-07 17:50:16 +00:00