|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| ... |  | 
| | 
| 
| 
| | llvm-svn: 185256 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | across scopes.
When we declare an extern "C" name that is not a redeclaration of an entity in
the same scope, check whether it redeclares some extern "C" entity from another
scope, and if not, check whether it conflicts with a (non-extern-"C") entity in
the translation unit.
When we declare a name in the translation unit that is not a redeclaration,
check whether it conflicts with any extern "C" entities (possibly from other
scopes).
llvm-svn: 185229 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | tag with that name in an enclosing scope.
r177473 made us correctly consider only those declarations in the
enclosing namespace scope when looking for a friend declaration. Under
ms-extensions mode, where we do some level of friend injection, this
meant that we were introducing a new tag type into a different scope
than what Microsoft actually does. Address this by only doing the
friend injection when we didn't see any tag with that name in any
outer scope. Fixes <rdar://problem/14250378>.
llvm-svn: 185100 | 
| | 
| 
| 
| 
| 
| | answer until after instantiation. Fixes PR16061!
llvm-svn: 184890 | 
| | 
| 
| 
| 
| 
| | WenHan Gu!
llvm-svn: 184875 | 
| | 
| 
| 
| | llvm-svn: 184378 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | We now reject things like
struct ABC {
  static double a;
};
register double ABC::a = 1.0;
llvm-svn: 184300 | 
| | 
| 
| 
| 
| 
| 
| | namespaces, by treating them just like we treat extern "C" declarations in
function scope.
llvm-svn: 184223 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows
more accurate detection of types of zero size. It however has a side effect -
sequence of used types may change, that is why the test 'override-layout' was
modified.
llvm-svn: 184088 | 
| | 
| 
| 
| 
| 
| | an asm label.
llvm-svn: 184069 | 
| | 
| 
| 
| 
| 
| 
| 
| | random checks for ObjC object return types to SemaType.cpp.
Fixes issue with ObjC method type checking reported on cfe-dev.
llvm-svn: 184006 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | __clear_cache is special. It needs no signature, but is a real function in
compiler_rt or libgcc.
Patch by Andrew Turner.
llvm-svn: 183926 | 
| | 
| 
| 
| | llvm-svn: 183725 | 
| | 
| 
| 
| 
| 
| 
| | Disallow the existence of a declaration of a member class that isn't a
forward declaration before it's definition.
llvm-svn: 183722 | 
| | 
| 
| 
| 
| 
| 
| 
| | Made significantly easier with git-clang-format.
Differential Revision: http://llvm-reviews.chandlerc.com/D947
llvm-svn: 183694 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | This reverts commit r183614.
It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.
llvm-svn: 183616 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This helps preserve the type-as-written in the AST, which we need for
MSVC mangling.  In particular, we need to preserve the types of array
parameters in function pointer types.
The essence of this change is:
-  QualType ArgTy = Param->getType();
+  QualType ArgTy = Param->getTypeSourceInfo()->getType();
... followed by the adjustment in ActOnFunctionDeclarator().
Differential Revision: http://llvm-reviews.chandlerc.com/D883
llvm-svn: 183614 | 
| | 
| 
| 
| 
| 
| | Differential Revision: http://llvm-reviews.chandlerc.com/D586
llvm-svn: 183609 | 
| | 
| 
| 
| 
| 
| 
| | references.  What's more, they use this language extension in their
ATL header files (which come as part of MFC and the Win32 SDK).  This patch implements support for the Microsoft extension, and addresses PR13737.
llvm-svn: 182936 | 
| | 
| 
| 
| 
| 
| 
| | C++ and C differ with respect to the handling of extern void
declarations. Enforce the C++ behavior in C++ mode.
llvm-svn: 182814 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | While the C++ standard requires that this lookup take place only at the
definition point of a virtual destructor (C++11 [class.dtor]p12), the
Microsoft ABI may require the compiler to emit a deleting destructor
for any virtual destructor declared in the TU, including ones without
a body, requiring an operator delete() lookup for every virtual
destructor declaration.  The result of the lookup should be the same
no matter which declaration is used (except in weird corner cases).
This change will cause us to reject some valid TUs in Microsoft ABI
mode, e.g.:
struct A {
  void operator delete(void *);
};
struct B {
  void operator delete(void *);
};
struct C : A, B {
  virtual ~C();
};
As Richard points out, every virtual function declared in a TU
(including this virtual destructor) is odr-used, so it must be defined
in any program which declares it, or the program is ill formed, no
diagnostic required.  Because we know that any definition of this
destructor will cause the lookup to fail, the compiler can choose to
issue a diagnostic here.
Differential Revision: http://llvm-reviews.chandlerc.com/D822
llvm-svn: 182270 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | selectany only applies to externally visible global variables.  It has
the effect of making the data weak_odr.
The MSDN docs suggest that unused definitions can only be dropped at
linktime, so Clang uses weak instead of linkonce.  MSVC optimizes away
references to constant selectany data, so it must assume that there is
only one definition, hence weak_odr.
Reviewers: espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D814
llvm-svn: 182266 | 
| | 
| 
| 
| 
| 
| | crash on an explicit specialization of a member function in a class scope.
llvm-svn: 181971 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This patch renames getLinkage to getLinkageInternal. Only code that
needs to handle UniqueExternalLinkage specially should call this.
Linkage, as defined in the c++ standard, is provided by
getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage.
Most places in the compiler actually want isExternallyVisible, which
handles UniqueExternalLinkage as internal.
llvm-svn: 181677 | 
| | 
| 
| 
| | llvm-svn: 181627 | 
| | 
| 
| 
| 
| 
| 
| | substitute 'void' into the return type rather than replacing it with 'void', so
that we maintain the 'auto' type sugar.
llvm-svn: 181584 | 
| | 
| 
| 
| 
| 
| 
| 
| | code as well.
rdar://13829073
llvm-svn: 181345 | 
| | 
| 
| 
| | llvm-svn: 181166 | 
| | 
| 
| 
| 
| 
| 
| | I was not able to find a case (other than the fix in r181163) where this
makes a difference, but it is a more obviously correct API to have.
llvm-svn: 181165 | 
| | 
| 
| 
| 
| 
| 
| | This fixes pr14958. I will audit other calls to isExternCContext to see
if there are any similar bugs left.
llvm-svn: 181163 | 
| | 
| 
| 
| 
| 
| 
| 
| | constructor from None
Patch by Robert Wilhelm.
llvm-svn: 181139 | 
| | 
| 
| 
| | llvm-svn: 181113 | 
| | 
| 
| 
| 
| 
| 
| | Missing (somewhat ironically) is support for the new deduction rules
in lambda functions, plus PCH support for return type patching.
llvm-svn: 181108 | 
| | 
| 
| 
| 
| 
| | diagnostic.
llvm-svn: 181103 | 
| | 
| 
| 
| 
| 
| | it when visiting such subexpressions.
llvm-svn: 181046 | 
| | 
| 
| 
| 
| 
| 
| 
| | InitializationSequence::Diagnose()
Patch by Robert Wilhelm.
llvm-svn: 181022 | 
| | 
| 
| 
| 
| 
| | Patch by Ismail Pazarbasi.
llvm-svn: 181011 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | arguments as expressions.
This change partly addresses a heinous problem we have with the
parsing of attribute arguments that are a lone identifier. Previously,
we would end up parsing the 'align' attribute of this as an expression
"(Align)":
 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align((Align)))) char storage[Size];
 };
while this would parse as a "parameter name" 'Align':
 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align(Align))) char storage[Size];
 };
The code that handles the alignment attribute would completely ignore
the parameter name, so the while the first of these would do what's
expected, the second would silently be equivalent to
 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align)) char storage[Size];
 };
i.e., use the maximal alignment rather than the specified alignment.
Address this by sniffing the "Args" provided in the TableGen
description of attributes. If the first argument is "obviously"
something that should be treated as an expression (rather than an
identifier to be matched later), parse it as an expression.
Fixes <rdar://problem/13700933>.
llvm-svn: 180973 | 
| | 
| 
| 
| | llvm-svn: 180972 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | arguments as expressions.
This change partly addresses a heinous problem we have with the
parsing of attribute arguments that are a lone identifier. Previously,
we would end up parsing the 'align' attribute of this as an expression
"(Align)":
  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align((Align)))) char storage[Size];
  };
while this would parse as a "parameter name" 'Align':
  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align(Align))) char storage[Size];
  };
The code that handles the alignment attribute would completely ignore
the parameter name, so the while the first of these would do what's
expected, the second would silently be equivalent to
  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align)) char storage[Size];
  };
i.e., use the maximal alignment rather than the specified alignment.
Address this by sniffing the "Args" provided in the TableGen
description of attributes. If the first argument is "obviously"
something that should be treated as an expression (rather than an
identifier to be matched later), parse it as an expression.
Fixes <rdar://problem/13700933>.
llvm-svn: 180970 | 
| | 
| 
| 
| | llvm-svn: 180808 | 
| | 
| 
| 
| 
| 
| 
| 
| | are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.
llvm-svn: 180789 | 
| | 
| 
| 
| 
| 
| | Patch by Robert Wilhelm.
llvm-svn: 180682 | 
| | 
| 
| 
| | llvm-svn: 180610 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Instead, we check for one line extern "C" context in linkage computation and
when deciding if a variable is a definition.
This hopefully completes the transition to having "as written" semantics for
hasExternalStorage.
llvm-svn: 180258 | 
| | 
| 
| 
| 
| 
| 
| 
| | statement in constexpr functions. Everything which doesn't require variable
mutation is also allowed as an extension in C++11. 'void' becomes a literal
type to support constexpr functions which return 'void'.
llvm-svn: 180022 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | C++1y, so stop adding the 'const' there. Provide a compatibility warning for
code relying on this in C++11, with a fix-it hint. Update our lazily-written
tests to add the const, except for those ones which were testing our
implementation of this rule.
llvm-svn: 179969 | 
| | 
| 
| 
| 
| 
| | Patch by Halfdan Ingvarsson!
llvm-svn: 179598 | 
| | 
| 
| 
| 
| 
| 
| 
| | It was being used correctly, but it is a very dangerous API to have around.
Instead, move the logic from the filtering to when we are deciding if we should
link two decls.
llvm-svn: 179523 | 
| | 
| 
| 
| 
| 
| | _Thread_local nor __thread.)
llvm-svn: 179517 |