[PATCH] Fix for PR18393 - emit error when abstract type is returned or taken by value

Robert Matusewicz matekm at gmail.com
Fri Sep 19 05:04:04 PDT 2014


Hi rsmith,

Hi,

Attached patch contains the implementation of a fix for PR18393[1]. According to standard "An abstract class shall not be used as a parameter type, as a function return type, or as the type of an explicit conversion" (class.abstract $10.4.3).

Currently, checking if type isn't abstract class is done when method is defined, but I don't see any reason why clang shouldn't do it as early as possible, in this case, when function/method is declared. Test also attached.

Please, review and provide feedback or propose additional tests.

Thanks in advance
Robert Matusewicz

http://reviews.llvm.org/D5409

Files:
  lib/Sema/SemaDecl.cpp
  test/SemaCXX/abstract.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5409.13862.patch
Type: text/x-patch
Size: 2248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140919/dc6c8c1b/attachment.bin>


More information about the cfe-commits mailing list