Commit Graph

26 Commits

Author SHA1 Message Date
Aaron Ballman ea03214a5e Detecting illegal instantiations of abstract types when using a function-style cast. Fixed PR12658.
llvm-svn: 156271
2012-05-07 00:02:00 +00:00
Richard Smith 9ca5c42582 Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!

llvm-svn: 141900
2011-10-13 22:29:44 +00:00
Douglas Gregor 385d3fd97d When checking for abstract types, don't crash when we have a
FunctionProtoTypeLoc with NULL function parameter types, which can
occur in invalid code. Fixes PR9247 / <rdar://problem/9037911>.

llvm-svn: 126262
2011-02-22 23:21:06 +00:00
Chandler Carruth fc1ad1f371 Update the test error messages to match the update I made to the actual
messages.

llvm-svn: 125997
2011-02-19 00:12:23 +00:00
Chandler Carruth 98e3c568bf Fix PR8767, improve diagnostic wording when allocating an object of an
abstract class type.

Patch by Stephen Hines, with a wording tweak from Doug applied by me.

llvm-svn: 125996
2011-02-18 23:59:51 +00:00
John McCall 8f42893aff Flesh out the test cases a little.
llvm-svn: 111359
2010-08-18 09:58:15 +00:00
John McCall 02db245d5e Rip out the existing retroactive abstract-class usage checker,
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class.  Also, look into templates when doing this.

llvm-svn: 111357
2010-08-18 09:41:07 +00:00
John McCall 38e5f433b2 Fix the build. Using declarations should not be considering when looking
for overridden virtual methods.

llvm-svn: 106096
2010-06-16 09:33:39 +00:00
Douglas Gregor 7d8072e038 Diagnose the use of abstract types as array element types. Previously,
we were relying on checking for abstract class types when an array
type was actually used to declare a variable, parameter, etc. However,
we need to check when the construct the array for, e.g., SFINAE
purposes (see DR337). Fixes problems with Boost's is_abstract type
trait. 

llvm-svn: 102452
2010-04-27 19:38:14 +00:00
Eli Friedman 5dd02a0f65 Correctly calcluate abstract-ness in the case where an implicitly declared
method overrides a pure virtual method.

llvm-svn: 91558
2009-12-16 20:00:27 +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 d5b2453722 Track overriding methods when instantiating a template class. Fixes PR5550.
llvm-svn: 89248
2009-11-18 21:51:29 +00:00
Anders Carlsson 7001794302 It's OK for a pure virtual function to override another pure virtual function. Fixes PR5222.
llvm-svn: 84428
2009-10-18 19:34:08 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Mike Stump 753d120975 Prep for new warning.
llvm-svn: 76709
2009-07-22 00:43:08 +00:00
Anders Carlsson 36b75a4619 Replace a cast with a dyn_cast as suggested by Doug.
llvm-svn: 72624
2009-05-30 17:26:39 +00:00
Anders Carlsson 65d5820892 Add a member lookup criteria constructor for searching for overridden virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298.
llvm-svn: 72601
2009-05-30 00:52:53 +00:00
Anders Carlsson 3c01271e93 Rewrite PureVirtualMethodCollector to use the overridden methods. Fixes <rdar://problem/6854087>
llvm-svn: 71970
2009-05-17 00:00:05 +00:00
Anders Carlsson b57738b09c Fix the bug that Eli noticed where we wouldn't look at function decls outside the class declaration.
llvm-svn: 67627
2009-03-24 17:23:42 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Anders Carlsson 8f0d218598 Handle pointers to arrays of abstract types.
llvm-svn: 67598
2009-03-24 01:46:45 +00:00
Anders Carlsson b5a27b460c More work on diagnosing abstract classes. We can now handle cases like
class C {
  void g(C c);

  virtual void f() = 0;
};

In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions. 

llvm-svn: 67594
2009-03-24 01:19:16 +00:00
Anders Carlsson eb0c532faa More improvements to abstract type checking. Handle arrays correctly, and make sure to check parameter types before they decay.
llvm-svn: 67550
2009-03-23 19:10:31 +00:00
Anders Carlsson 0d5ca29b78 It's an error to try to allocate an abstract object using new.
llvm-svn: 67542
2009-03-23 17:49:10 +00:00
Anders Carlsson 576cc6f725 Disallow abstract types where appropriate.
llvm-svn: 67476
2009-03-22 20:18:17 +00:00
Anders Carlsson 7cbd8fb6b0 Keep track of whether a class is abstract or not. This is currently only used for the __is_abstract type trait.
llvm-svn: 67461
2009-03-22 01:52:17 +00:00