Commit Graph

7 Commits

Author SHA1 Message Date
Richard Smith c084bd2888 PR15132: Replace "address expression must be an lvalue or a function
designator" diagnostic with more correct and more human-friendly "cannot take
address of rvalue of type 'T'".

For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully
saying "cannot take address of rvalue of type '<overloaded function type>'".

For the case of &array_temporary, treat it just like a class temporary
(including allowing it as an extension); the existing diagnostic wording
for the class temporary case works fine.

llvm-svn: 174262
2013-02-02 02:14:45 +00:00
Nick Lewycky 45b5052834 This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug that caused us to not mark the function referenced just
because we didn't want to mark it odr used.

llvm-svn: 174242
2013-02-02 00:25:55 +00:00
Douglas Gregor 668d362503 Only allow taking the address of an expression of type 'overloaded
function type' when that expression is actually an overloaded function
reference (and not the address of an overloaded function
reference). Fixes PR11066. 

llvm-svn: 141514
2011-10-09 19:10:41 +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
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
Nuno Lopes 5773a1be41 fix PR 3222: allow one to get the address of a global function in C++
llvm-svn: 61111
2008-12-16 22:58:26 +00:00
Douglas Gregor 9aa8b55d10 Fix PR clang/3175: CheckAddressOfOperand does not handle references to class vars
llvm-svn: 60849
2008-12-10 21:26:49 +00:00